Extend pipeline autest to verify HTTP/1.1 request framing#13402
Open
bneradt wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens ATS’s HTTP/1.1 request-framing regression coverage in the existing pipeline gold test suite by adding a purpose-built origin recorder and a raw-socket client to validate that pipelined boundaries are preserved and that ambiguous framing (conflicting Content-Length) is rejected.
Changes:
- Add a recording origin helper that parses headers and a
Content-Lengthbody to log request boundaries as received. - Add a raw-socket client helper that can send either a
Content-Length: 0POST followed by a pipelined request, or a request with conflictingContent-Lengthheaders. - Extend
pipeline.test.pywith two new runs that exercise these framing shapes against ATS as a reverse proxy.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/gold_tests/pipeline/request_framing_server.py | New origin helper to parse/log request framing and respond per-request so tests can verify boundaries. |
| tests/gold_tests/pipeline/request_framing_client.py | New client helper to generate the two framing scenarios and print received responses for assertions. |
| tests/gold_tests/pipeline/pipeline.test.py | Adds TestRequestFraming runs and assertions to validate correct pipelining behavior and rejection of conflicting Content-Length. |
Traffic Server already handles these request shapes correctly; this patch adds no product code and changes no behavior. It only adds test coverage so that the currently correct handling cannot regress unnoticed. A proxy that disagrees with its origin about where a request body ends can be desynchronized from that origin. Two common shapes provoke this: pipelining a body-less POST (Content-Length: 0) ahead of a second request, and sending a request with conflicting Content-Length header fields. Traffic Server must keep such request boundaries intact. This extends the pipeline autest with two runs that exercise those shapes. This confirms that Traffic Server delivers the pipelined requests to the origin as two independent requests, so the second request cannot be folded into the first, and that it rejects the ambiguously-framed request rather than forwarding it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bneradt
force-pushed
the
request-framing-autest
branch
from
July 17, 2026 23:17
5d60042 to
81a3b0d
Compare
Comment on lines
+96
to
+110
| sock.settimeout(5.0) | ||
| responses = b"" | ||
| try: | ||
| while True: | ||
| data = sock.recv(4096) | ||
| if not data: | ||
| break | ||
| responses += data | ||
| # We expect at most two responses; stop once we have both status | ||
| # lines and the connection goes quiet. | ||
| if responses.count(b'HTTP/1.1') >= 2 and responses.endswith(b'\n'): | ||
| break | ||
| except socket.timeout: | ||
| print('Read timed out.') | ||
|
|
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.
Traffic Server already handles these request shapes correctly; this
patch adds no product code and changes no behavior. It only adds test
coverage so that the currently correct handling cannot regress
unnoticed.
A proxy that disagrees with its origin about where a request body ends
can be desynchronized from that origin. Two common shapes provoke this:
pipelining a body-less POST (Content-Length: 0) ahead of a second
request, and sending a request with conflicting Content-Length header
fields. Traffic Server must keep such request boundaries intact.
This extends the pipeline autest with two runs that exercise those
shapes. This confirms that Traffic Server delivers the pipelined
requests to the origin as two independent requests, so the second
request cannot be folded into the first, and that it rejects the
ambiguously-framed request rather than forwarding it.