Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include X-Rate headers only for successfully requests #15

Conversation

michaelvickersuk
Copy link

Genderize does not return the X-Rate headers for unsuccessful requests, eg when the rate limit has been exceeded, missing or incorrect params are supplied. When such an event takes place an error occurs as the $data->headers[X-Rate-*] array key is not set.

Genderize does not return the X-Rate headers for unsuccessful
requests, eg when the rate limit has been exceeded
@coveralls
Copy link

coveralls commented Oct 1, 2019

Coverage Status

Coverage increased (+0.04%) to 98.611% when pulling 9167140 on michaelvickersuk:x-rate-headers-on-success into fde6f31 on pixelpeter:master.

@Stroemgren
Copy link

I might push an update to the API in the next days to fix this and return the headers for requests that fail due to limits.

@Stroemgren
Copy link

The API now will return the X-Rate-* headers for requests that fail with status 429. Can be either "Request limit reached" or "Request limit too low to process request" for batch requests.

Thanks so much for keeping this repository!

API now will return the X-Rate-* headers for requests that fail
with status 429. Can be either "Request limit reached" or
"Request limit too low to process request" for batch requests.
@michaelvickersuk
Copy link
Author

Thanks @Stroemgren 👍

I've now included any requests returning status 429 so the X-Rate-* headers will be available through $response->meta

@pixelpeter
Copy link
Owner

I will take care of this this weekend. Thanks so far!

@michaelvickersuk
Copy link
Author

@pixelpeter please can this be merged

@michaelvickersuk
Copy link
Author

Closing due to inactivity and Laravel 5 no longer receiving support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants