-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Seemingly incorrect relocation after HTTP/1.1 302 Found #4859
Comments
You're not telling us the whole story. You started saying you used Further down you then say "a PUT request was made", which implies you used more options to get that effect but didn't tell us how.
|
OK; I've explicitly ordered PUT with
By "a PUT request was made" I meant "curl made a PUT request", see the curl's debug print.
The full command line was
Configuration file contains only directives to set the client's SSL certificate.
While I agree that curl's behavior is consistent with RFC 7231, it is completely different from what is written in the manpage, which tells that curl responds to HTTP 302 with GET no matter which method was used before. |
Yes, the documentation isn't as accurate as it should be (I would not call it "completely different" though) Still, that doesn't matter to your case since you override that decision with |
Not from generic non-GET to GET. Ref: #4859
Right, However, substituting |
There's no HTTP redirect response code to tell a client to change from PUT to GET. A client that sends a PUT should sent a PUT again after a 302 when following a redirect. If the server doesn't want/support this, then it should probably not redirect the PUT to begin with! |
I am not talking about the server at all. I am talking about curl's documentation, which until 7929550 said that redirects after non-GET requests (PUT included) result in curl making a GET. |
Sorry, I thought the issue was the originally shown command line and how curl behaved on that server response. With the update docs I think this case is closed. |
I agree. Thanks for prompt response. |
Thanks, closing! |
I came upon a strange behavior of relocation. I believe it to be a bug, as this behavior seems to contradict the one described in the manual, as well as the debug print of curl itself.
I did this
Issued a HTTP/1.1 PUT request with
--header 'Content-Type: application/json' -d @sample.json
and--location
. The site responded withHTTP/1.1 302 Found
withLocation
header, which is an expected response.curl redid the request to the new location with the following debug print:
I expected the following
As per curl's manpage in Debian,
Also, the debug print line:
I have expected a GET request to be made. However, a PUT request was made with
Content-Type: application/json
and empty content. The remote site responded withHTTP/1.1 400 Bad Request
telling that empty JSON file is a malformed JSON file.curl/libcurl version
Got the same with
curl 7.58.0 (x86_64-pc-linux-gnu)
too.operating system
Debian unstable as of 2020-01-28 03:15:57-05:00
The text was updated successfully, but these errors were encountered: