-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Redirect (301) after POST re-reads file #9735
Labels
Comments
The 301 doesn't come back until *after* the data is sent the first time. I
think it might be possible to overcome this by forcing the 100-Continue logic
which should send the redirect before the data is sent.
|
The problem is that curl considers and performs the rewind already when it sees the |
bagder
added a commit
that referenced
this issue
Nov 22, 2022
This makes a big difference for cases when the second request is not actually performed (for exampel HTTP respons code 301 converts to GET) and thererfore the rewind can be avoided. In particular for situations when that rewind *fails*. Reported-by: Ali Utku Selen Fixes #9735 Closes #....
bagder
added a commit
that referenced
this issue
Nov 22, 2022
Reproduces #9735 and verifies the subsequent fix. The original issue uses a pipe that cannot be rewound, but this test case instead sets a callback without rewind ability to get roughly the same properties but being a much more portable test.
bagder
added a commit
that referenced
this issue
Nov 22, 2022
This makes a big difference for cases when the second request is not actually performed (for example HTTP response code 301 converts to GET) and therefore the rewind can be avoided. In particular for situations when that rewind *fails*. Reported-by: Ali Utku Selen Fixes #9735 Closes #....
bagder
added a commit
that referenced
this issue
Nov 22, 2022
Reproduces #9735 and verifies the subsequent fix. The original issue uses a pipe that cannot be rewound, but this test case instead sets a callback without rewind ability to get roughly the same properties but being a much more portable test.
bagder
added a commit
that referenced
this issue
Nov 22, 2022
Reproduces #9735 and verifies the subsequent fix. The original issue uses a pipe that cannot be rewound, but this test case instead sets a callback without rewind ability to get roughly the same properties but being a much more portable test.
bagder
added a commit
that referenced
this issue
Nov 22, 2022
Reproduces #9735 and verifies the subsequent fix. The original issue uses a pipe that cannot be rewound, but this test case instead sets a callback without rewind ability to get roughly the same properties but being a much more portable test.
bagder
added a commit
that referenced
this issue
Nov 24, 2022
Reproduces #9735 and verifies the subsequent fix. The original issue uses a pipe that cannot be rewound, but this test case instead sets a callback without rewind ability to get roughly the same properties but being a much more portable test.
bagder
added a commit
that referenced
this issue
Nov 25, 2022
Reproduces #9735 and verifies the subsequent fix. The original issue uses a pipe that cannot be rewound, but this test case instead sets a callback without rewind ability to get roughly the same properties but being a much more portable test.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did this
Some python3 code to imitate the server I was working with
$ python3 server.py
$ curl -v -F content=@<(echo hello) -L localhost:9000
...
curl: (65) Cannot rewind mime/post data
I expected the following
Reading https://everything.curl.dev/http/redirects, I wouldn't expect curl to try to rewind my input file (process substitution) when redirect is just a 301 and switches to GET.
curl/libcurl version
I tried with a local build and some prebuilt binary.
curl 7.86.0-DEV, 7.68.0
operating system
.
The text was updated successfully, but these errors were encountered: