rootvector2 opened a new pull request, #751: URL: https://github.com/apache/httpcomponents-core/pull/751
`DefaultConnectionReuseStrategy.keepAlive` treats an HTTP/1.0 response with `Transfer-Encoding` as faulty framing, but not an HTTP/1.0 request. The server still decodes `POST / HTTP/1.0` with `Transfer-Encoding: chunked` and `Connection: keep-alive` as chunked, keeps the connection open, and parses the bytes after the body as the next request. An HTTP/1.0 intermediary doesn't know `Transfer-Encoding` and frames that request differently. I found this by reading the reuse strategy against RFC 9112 section 6.1 and confirmed it on the classic server with a raw socket: before the fix a pipelined `GET` after such a request reaches the handler, and after it the connection closes once the first response is sent. The fix adds the request-side rule from RFC 9112 section 6.1, next to the existing check for a request with both `Content-Length` and `Transfer-Encoding`. It's a single header lookup per exchange and applies only to HTTP/1.0 requests, so HTTP/1.1 traffic is unaffected. `testRequestHTTP10TransferEncodingPresent` covers it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
