Skip to content

close connection after http/1.0 request with transfer-encoding - #751

Merged
ok2c merged 2 commits into
apache:masterfrom
rootvector2:http10-request-te-close
Nov 20, 2026
Merged

ok2c merged 2 commits into
apache:masterfrom
rootvector2:http10-request-te-close

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

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.

@ok2c
ok2c merged commit 396da63 into apache:master Nov 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants