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

Add ability to set Retry-After header on 429 and 503 exceptions #1677

Merged
merged 2 commits into from
Jan 5, 2020
Merged

Add ability to set Retry-After header on 429 and 503 exceptions #1677

merged 2 commits into from
Jan 5, 2020

Conversation

aenglander
Copy link
Contributor

Added optional retry_after_secs to TooManyRequests exception init.
This brings the output in line with the HTTP spec.
Resolves #1657

@aenglander aenglander changed the base branch from 0.16.x to master December 2, 2019 03:06
src/werkzeug/exceptions.py Outdated Show resolved Hide resolved
src/werkzeug/exceptions.py Outdated Show resolved Hide resolved
src/werkzeug/exceptions.py Outdated Show resolved Hide resolved
@davidism davidism added this to the 1.0.0 milestone Jan 4, 2020
Added optional retry_after_secs to TooManyRequests exception init.
This brings the output in line with the HTTP spec.
@davidism davidism changed the title Add ability to set Retry-After header to 429 Too Many Requests response. Add ability to set Retry-After header on 429 and 503 exceptions Jan 5, 2020
@davidism davidism requested a review from pgjones January 5, 2020 03:22
@davidism
Copy link
Member

davidism commented Jan 5, 2020

This header also applies to 503 Service Unavailable, so I extracted the behavior to a common base class for 429 and 503. From @pgjones, retry_after can be a datetime that is serialized using http_date.

@davidism davidism merged commit b9d394d into pallets:master Jan 5, 2020
@pgjones
Copy link
Member

pgjones commented Jan 5, 2020

👍

@aenglander aenglander deleted the feature/1657-too-many-requests-support-retry-after branch May 5, 2020 00:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TooManyRequests: Support Retry-After
3 participants