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
Curl doesn't send request body when the server responds with HTTP 101 #12022
Comments
I bet the double 10x responses is the reason. |
This is not a valid server response. It points to a bug in the server. |
https://datatracker.ietf.org/doc/html/rfc7230#section-6.7 appears to suggest that the server response is valid:
|
Ah, @djelinski thanks for the link. You learn something new every day. In Apache httpd, I never allow protocol switching on requests with a body. Which allows me to remain ignorant so far of these intricacies. The easiest way to fix the curl handling of this would be, my guess, to never send |
Sensible. Or do it like you mention Apache does, avoid the upgrade if there's a request body. |
Reported-by: Daniel Jelinski Fixes #12022
Reported-by: Daniel Jelinski Fixes curl#12022 Closes curl#12062
I did this
Using a local Liberty server and curl 8.3.0 client, I sent a HTTP POST request over plain HTTP1 as follows:
The server sent the following 2 response headers in quick succession:
In response to that, Curl sent the HTTP2 connection preface without sending the data.
It doesn't fail every time; sometimes when the HTTP 101 header is late enough, curl manages to send the request body correctly.
I expected the following
I expected curl to send the request data before sending the HTTP2 preface
curl/libcurl version
curl 8.3.0 (x86_64-w64-mingw32) libcurl/8.3.0 OpenSSL/3.1.2 (Schannel) zlib/1.3 brotli/1.1.0 zstd/1.5.5 WinIDN libssh2/1.11.0 nghttp2/1.56.0 ngtcp2/0.19.1 nghttp3/0.15.0
operating system
Windows 11
The text was updated successfully, but these errors were encountered: