-
-
Notifications
You must be signed in to change notification settings - Fork 919
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
retry status 302 does not retry requests #1694
Comments
@gajus As suggested by the documentation you need to set something like this explicitly:
|
@mindnuts I don't understand what you are implying. As shown in my code example, I did set which status code should be retried. |
My bad, i thought you were making a "POST" request, and they are not retried by default. |
Is this now a confirmed bug? |
RFC 7231 HTTP/1.1 Semantics and Content June 2014
6.4.3. 302 Found
The 302 (Found) status code indicates that the target resource
resides temporarily under a different URI. Since the redirection
might be altered on occasion, the client ought to continue to use the
effective request URI for future requests.
The server SHOULD generate a Location header field in the response
containing a URI reference for the different URI. The user agent MAY
use the Location field value for automatic redirection. The server's
response payload usually contains a short hypertext note with a
hyperlink to the different URI(s).
Note: For historical reasons, a user agent MAY change the request
method from POST to GET for the subsequent request. If this
behavior is undesired, the 307 (Temporary Redirect) status code
can be used instead. |
Hmm I think it should retry. Lemme see |
Actually this is not a bug. |
@sindresorhus I'm wondering if we should change this behavior. Or we can just document that successful status codes are ignored and |
I'm afraid that if we changed this behavior then it could be misused. It's still possible to throw |
(sorry, attached wrong issue, reopened) |
I'm concerned about this too. I think we should just clearly document the behavior. |
Describe the bug
Actual behavior
got makes request only once.
In the case of provided code example, "OK" is printed only once.
Expected behavior
got should make request 10 times.
Code to reproduce
You will also need a simple HTTP route, e.g.
Checklist
The text was updated successfully, but these errors were encountered: