Skip to content

Do not reuse the connection unless the request body was fully sent - #360

Open
mame wants to merge 2 commits into
ruby:masterfrom
mame:expect-continue-close
Open

mame wants to merge 2 commits into
ruby:masterfrom
mame:expect-continue-close

Conversation

@mame

@mame mame commented Nov 2, 2026

Copy link
Copy Markdown
Member

When the server answers a request that carries Expect: 100-continue with a final status before the body has been sent, or when writing the body fails partway, the announced body never reaches the server in full. Close the connection after reading the response instead of keeping it alive for the next request. This follows the behavior of Java's java.net.http.HttpClient, which closes the connection after any response other than 100 to such a request, and of libcurl, which closes it when the body has not been sent completely.

Reported-by: Claude (Anthropic) and Stephan Lipp (Ada Logics)

mame and others added 2 commits November 11, 2026 18:20
When the server answers a request that carries Expect: 100-continue with
a final status before the body has been sent, or when writing the body
fails partway, the announced body never reaches the server in full.
Close the connection after reading the response instead of keeping it
alive for the next request. This follows the behavior of Java's
java.net.http.HttpClient, which closes the connection after any response
other than 100 to such a request, and of libcurl, which closes it when
the body has not been sent completely.

Reported-by: Claude (Anthropic) and Stephan Lipp (Ada Logics)
Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
wait_for_continue treated any response other than 100 Continue as the
final response, so an informational response such as 103 Early Hints
before 100 Continue made the request return 103 without sending its body.
Skip informational responses other than 100 and 101 until 100 Continue,
a final response, or the continue timeout.

Reported-by: Ashton D (https://hackerone.com/ashdfrkl)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mame
mame force-pushed the expect-continue-close branch from cd419fa to 3ba12ae Compare November 23, 2026 09:56

This branch has not been deployed

No deployments
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.

1 participant