-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix: Handle Retry-After headers better for 429 responses #3464
Conversation
* Card ID: CCT-759 We have to ensure we normalize the headers before we search for the Retry-After header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -500,10 +500,14 @@ class RateLimitExceededException(RestlibException): | |||
The retry_after attribute may not be included in the response. | |||
""" | |||
|
|||
def __init__(self, code: int, msg: str = None, headers: str = None) -> None: | |||
def __init__(self, code: int, msg: str = None, headers: dict = None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type hint of headers
was just wrong, right? I can see that this exception is raised in validateResult()
and it seems that the headers
is dict there.
We have to ensure we normalize the headers before we search for the
Retry-After
header.