Pirate-Weather / pirateweather

Code and documentation for the Pirate Weather API
Apache License 2.0
670 stars 29 forks source link

`RateLimit-Reset` header returns wrong value #333

Closed mbomb007 closed 2 months ago

mbomb007 commented 2 months ago

Describe the bug

When I get the value of the RateLimit-Reset header in the API response, it returned 1217931. It's supposed to return the Unix timestamp, and this would be the timestamp for 1/14/1970 - 8:20 pm...

Expected behavior

Return the Unix timestamp in UTC for the date the rate limit resets.

Actual behavior

Returns a number far too small.

API Endpoint

Production

Location

N/A

Other details

No response

Troubleshooting steps

cloneofghosts commented 2 months ago

Thanks for the report. The documentation states that Ratelimit-Reset is the time in seconds until your rate limit resets.

It should be possible to change it to a UNIX Timestamp but I'll leave it up to @alexander0042 to decide

mbomb007 commented 2 months ago

Ah, that's right. Never mind. I just need to add time() +.