-
-
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
<6 bytes HTTP responses "vanish" #2420
Comments
Given how rare it will be in the wild compared to broken servers, is it reasonable to assume HTTP/0.9 unless explicitly specified? That being said, there is no |
I would say that most users probably don't even think of HTTP/0.9 and will be surprised when curl would handle such responses. While |
On 19 Apr 2018, at 21:21, Daniel Stenberg ***@***.***> wrote:
I would say that most users probably don't even think of HTTP/0.9 and will be surprised when curl would handle such responses.
While --http0.9 seems a bit weird to add at this point, I still think that's the best way forward for this…
I think so too. Unless you’re already on it, I can take a stab at it for the next window.
|
Please have a go at it! The only thing I've done on this is the recipe mentioned above that reproduces the problem... |
Deal with tiny "HTTP/0.9" (header-less) responses by checking the status-line early, even before a full "HTTP/" is received to allow detecting 0.9 properly. Test 1266 and 1267 added to verify. Fixes #2420
Deal with tiny "HTTP/0.9" (header-less) responses by checking the status-line early, even before a full "HTTP/" is received to allow detecting 0.9 properly. Test 1266 and 1267 added to verify. Fixes #2420
I did this
The zeros in all columns is what's notable. The server sent 5 bytes. Adding
-i
doesn't help, the 5 bytes are not to be seen; they are not stored in the output file.I expected the following
Not sure.
curl has support for "HTTP/0.9" which is header-less and is just a response-body until connection close. But since curl doesn't know what HTTP version that comes, it buffers the data to check the first header line. This small amount of data never gets checked since the code wants >5 bytes before it checks.
Since it never qualifies as a header, it should probably be considered a body and get delivered as such when it reaches the end of the transfer without confirming it to be a header.
curl/libcurl version
git master, but this is ancient bug. Presumably this is not an actual problem to many users.
operating system
doesn't matter
The text was updated successfully, but these errors were encountered: