-
Notifications
You must be signed in to change notification settings - Fork 257
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
support HTTPDate in Retry-After header #138
support HTTPDate in Retry-After header #138
Conversation
ea16331
to
2cbfe34
Compare
According to [RFC7231](https://httpwg.org/specs/rfc7231.html#header.retry-after) the Retry-After header may be specified in both number of seconds OR an HTTPDate > The value of this field can be either an HTTP-date or a number of seconds to delay after the response is received. > > Retry-After = HTTP-date / delay-seconds > > A delay-seconds value is a non-negative decimal integer, representing time in seconds. > > delay-seconds = 1*DIGIT > > Two examples of its use are > > Retry-After: Fri, 31 Dec 1999 23:59:59 GMT > Retry-After: 120 This change adds support for parsing the date if the format of the header contains non-numeric characters
2cbfe34
to
e16f958
Compare
8b0038a
to
badefbb
Compare
Removes dependency on regular expressions for detecting numeric header values vs date values
badefbb
to
f2396f0
Compare
Hi, I have seen a few pull requests like this that are updated whenever the last pull request have conflicts with current version. Can Hashicorp add this functionality, please? |
I opened #144 for discussion about the feature. Given that there are now 3 PRs that accomplish the same thing, we should probably consolidate discussion in a single place. |
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.
@justenwalker Thanks for submitting this PR! Although there are a few open PRs aiming to add this functionality, this feels like the cleanest and most robust implementation. As such I'll merge this for inclusion in an upcoming release. Thanks again.
According to RFC7231
the Retry-After header may be specified in both number of seconds OR an HTTPDate
This change adds support for parsing the date if the format of the header contains non-numeric characters
Closes: #144