Preserve prepared requests on HTTP/2 fallback - #1341
Draft
quinnj wants to merge 1 commit into
Draft
Conversation
Reuse the prepared request when automatic HTTP/2 negotiation falls back to HTTP/1.1. This preserves trace-time signing and other mutations made after the request copy was created. Cover the TLS fallback path with a trace-added Authorization header.
quinnj
force-pushed
the
jq/preserve-trace-on-auto-fallback
branch
from
July 29, 2026 22:07
6a58e12 to
a31ef60
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1341 +/- ##
==========================================
+ Coverage 88.30% 88.32% +0.01%
==========================================
Files 30 30
Lines 11916 11915 -1
==========================================
+ Hits 10523 10524 +1
+ Misses 1393 1391 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
RequestEventand verifies that the HTTP/1.1 server receives the signature.Root cause
_do_incoming!created and traced a send request before it tried HTTP/2. When ALPN selected HTTP/1.1, the fallback path discarded that prepared request and copied the unchanged source request again. The second copy lost all changes made after the first copy, including trace-time signing and cookie insertion.The ALPN failure happens during connection setup. No HTTP request body has been sent or consumed at that point. The fallback can safely send the already prepared request.
User impact
Callers can keep HTTP.jl's default
protocol=:autobehavior. Authenticated clients no longer need to force HTTP/1.1 to keep trace-time request signatures on fallback.Validation
Authorizationheader.Pkg.test()on Julia 1.12.6. The full HTTP.jl suite passed, including all 63 trim-compile checks.Co-authored by Codex