-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
hyper adds suprise Content-Length header #13380
Comments
Most probably caused by this: hyperium/hyper@172fdfa |
Most request methods define a payload. If hyper detects that no body has been included, it will now include a `content-length: 0` header automatically. It will not do this for methods that don't have defined payloads (GET, HEAD, and CONNECT).
The initial issue reporter in reqwest (seanmonstar/reqwest#2240) raises a fair point, that as per the RFC a user-agent SHOULD include the This may be an intentional decision to honor the |
It should "when the method defines a meaning for enclosed content". This is not the case for GET/HEAD/DELETE/CONNECT. |
Right, hyper seems to have addressed it only for the methods where it SHOULD in hyperium/hyper#3630 (well looks like they forgot cURL (at least on CLI) does not include it, even for
And on the receiver:
(or alternatively, hexdump):
|
|
Looking at the failed tests, three of them are due to
I guess hyper should not be applying the header for these methods. The other failure is for a "custom" method ( Line 47 in a1ecd0b
|
But it sounds like being able to have that special behavior is on purpose, and curl would rather keep it. Right? I can revert it in hyper, and say that "user agents" should do that themselves. Or I could leave it in by default with an option "I know what I'm doing". I suspect most want the behavior, so that's what I'm leaning towards. |
@seanmonstar I think that's up for you and other hyper maintainers to decide. For curl use, I prefer as little "intelligence" as possible from hyper on matters such as this. |
This was reverted in hyper: hyperium/hyper#3633 A re-run of the curl CI should get the fix. |
Thanks @seanmonstar ! |
I did this
Build curl with current hyper, run test suite. The first merged commit with this failed CI seems to be dde4b38. The CI job gets the current git master from Hyper so it seems reasonable to assume that Hyper has changed in this time period.
Well established test cases fail.
For example test 13:
The text was updated successfully, but these errors were encountered: