| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
feedback in #69. if we merge something, i will then up-merge 3.x to 4.x to keep the commit history clean. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What's in this PR?
This relaxes the request assertion for HEAD requests so a client may omit Content-Length when the server did not receive one. The assertion still checks Content-Length when a client sends it, and keeps the existing TRACE behavior.
Why?
The test suite currently makes Content-Length mandatory for HEAD requests because the default request headers include Content-Length: 0, and bodied test cases replace it with the body length. That is too strict for clients and transports that intentionally suppress HEAD request content.
If such a client kept a positive Content-Length while sending no body, the wire message would declare bytes that never arrive, which can make servers wait for the missing request body or corrupt connection framing. A missing Content-Length is valid for a HEAD request with no transmitted content, and this change only tolerates that absence; it still validates the header value when a client sends one.
Guzzle needs this while fixing guzzle/guzzle#3728 because its cURL handler must use cURL's no-body mode for HEAD requests to avoid waiting for response bodies that valid HEAD responses do not send. That mode suppresses request uploads, so Guzzle also has to omit positive request Content-Length values rather than send misleading framing headers.
Checklist