SpaceTradersAPI / api-docs

The API documentation for the SpaceTraders API
143 stars 36 forks source link

Invalid Retry-After headers #24

Closed dbeckwith closed 1 year ago

dbeckwith commented 1 year ago

I'm using the Space Traders API in Python with a client generated by openapi-generator. When I hit rate-limit errors, I get an error from the underlying urllib3 library used for the network handling:

urllib3.exceptions.InvalidHeader: Invalid Retry-After header: 0.493

According to MDN, the Retry-After header value must be either a date string or an integer number of seconds.

galdor commented 1 year ago

Correct, see RFC 9110. If you need sub-second precision (which is the case here), you have to use a custom header field.

space-admiral commented 1 year ago

Ok good to know, I think we'll round this up the the full second so it doesn't break client generators. Really appreciate you catching this!

dbeckwith commented 1 year ago

Seems like this has been fixed now?