-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Content-Length sent for OPTIONS requests #1310
Comments
Thanks for the report @ansman, this seems like an issue in the underlying library we use (requests): I'll send a temporary fix for HTTPie, and a more permanent fix for the the |
Even though MDN agrees this by stating
RFC 7231 claims:
which implies that
I am not sure whether we should omit the cURL seem to omit it: $ curl --trace-ascii - -X OPTIONS http://example.org -i
== Info: Trying 93.184.216.34:80...
== Info: Trying 2606:2800:220:1:248:1893:25c8:1946:80...
== Info: Immediate connect fail for 2606:2800:220:1:248:1893:25c8:1946: Network is unreachable
== Info: Connected to example.org (93.184.216.34) port 80 (#0)
=> Send header, 79 bytes (0x4f)
0000: OPTIONS / HTTP/1.1
0014: Host: example.org
0027: User-Agent: curl/7.74.0
0040: Accept: */*
004d: $ curl --trace-ascii - -X OPTIONS http://example.org -i --data 'x'
== Info: Trying 93.184.216.34:80...
== Info: Connected to example.org (93.184.216.34) port 80 (#0)
=> Send header, 147 bytes (0x93)
0000: OPTIONS / HTTP/1.1
0014: Host: example.org
0027: User-Agent: curl/7.74.0
0040: Accept: */*
004d: Content-Length: 1
0060: Content-Type: application/x-www-form-urlencoded
0091:
=> Send data, 1 bytes (0x1)
0000: x |
Checklist
Minimal reproduction code and steps
$ http OPTIONS https://example.com -v
Current result
Expected result
Debug output
Please re-run the command with
--debug
, then copy the entire command & output and paste both below:Additional information, screenshots, or code examples
Since
OPTIONS
requests are not permitted to have a body theContent-Length
header should not be included by default.The text was updated successfully, but these errors were encountered: