-
Notifications
You must be signed in to change notification settings - Fork 18.1k
http/client - edge case on POST and redirect #70174
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
Comments
see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308
modifying the request is incorrect for 308 |
So how it come and change my method to GET? |
that's the 301 |
Our handling of redirects is consistent with other tools such as curl. If you need different behaviour, CheckRedirect is available for you to set. |
I've checked with curl...
Go
So you should check that.. there is something wrong with the redirections... |
Uh oh!
There was an error while loading. Please reload this page.
Go version
1.23.2
Output of
go env
in your module/workspace:What did you do?
Using simple http client to execute POST with body the server response with series of redirect and enter loop (till reached to 10th redirects).
I used Burp (Fiddler like) to see the communication b/w the client and server.
What did you see happen?
The go client received several redirect responses
302 -> 301 -> 308 -> 302 -> 301 -> 308... until it reached to the 10th redirects.
What did you expect to see?
It was supposed to stop after the 308.
The reason is simple it should send the last one w/o body and Content Length.
I was able to modify the Go SDK (net/http/client.go) with this change on function redirectBehavior
The text was updated successfully, but these errors were encountered: