Repository navigation
fix: read a refused request's body so the next request on the connection survives - #104
Merged
Merged
Conversation
…ion survives A POST or PUT to a game host (405) or an unknown host (404) was answered without reading its body. On a kept-alive proxy connection the body was then parsed as the start of the next request, which got a 501. Forward One beacons to its own origin, so the clip it loaded next broke at random. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A POST or PUT to a game host (405) or to an unknown host (404) was answered without reading its body. On a kept-alive connection, which Traefik reuses, the unread body was then parsed as the start of the next request, and that request was answered 501.
Found live on forward-one.play.danielstephenson.dev: Forward One beacons a small JSON event to
/api/river-logon its own origin, and the guide-voice clip loaded straight after it (/audio/guide/*/forward-4.wav) failed with 501 on most page loads, while the same file fetched alone returned 200._dispatchnow calls the existing_drain()(read a body up to 1 MiB, otherwise close the connection) before each of those refusals. The API host is unchanged: it already reads or drains its own bodies.Test:
test_a_refused_post_does_not_poison_the_next_request_on_a_kept_alive_connectionsends a POST/PUT with a body to a game host and an unknown host, then a GET on the same connection. It failed before the fix (501) and passes after. Full suite: 686 passed.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code