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

Request parameters and headers to change the behaviour of the 429 Too Many Requests response. #137

Closed
wants to merge 2 commits into from

Conversation

jimbojim1997
Copy link

This PR adds two request parameters and headers which change the value of the response header Retry-After of the 429: Too Many Requests response.

Parameter seconds / header X-Retry-After-Seconds

  • Sets the number of seconds used for the Retry-After response header.
  • Default: 5 seconds (same as existing implementation).

Parameter format / header X-Retry-After-Format:

  • Sets the format of the Retry-After resonse header.
  • Accepted values:
    • Any value returns a number of seconds
    • date returns the current time + seconds in the HTTP Date format.
  • Default: seconds format (same as existing implementation).

Also includes tests and additional information on the home page detailing these parameters.

…, format and request headers X-Retry-After-Seconds, X-Retry-After-Format which alter the response Retry-After header value and format.
@aaronpowell
Copy link
Owner

Finally getting to do a cleanup on the repo, and looking at this PR, I think it does much more than is really desired, I think it'd be a lot simpler if I just added a way to provide a custom response header value, and then from the caller you can specify that in the request and it just returns what you requested.

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

2 participants