Skip to content

Fix HTTP auto fallback on h2 ALPN rejection#1269

Merged
quinnj merged 1 commit into
masterfrom
codex/auto-alpn-fallback
Jun 1, 2026
Merged

Fix HTTP auto fallback on h2 ALPN rejection#1269
quinnj merged 1 commit into
masterfrom
codex/auto-alpn-fallback

Conversation

@quinnj
Copy link
Copy Markdown
Member

@quinnj quinnj commented Jun 1, 2026

Summary

  • offer http/1.1 alongside h2 for the default high-level protocol=:auto h2 probe
  • keep explicit protocol=:h2 strict and continue honoring user-specified ALPN lists verbatim
  • update the TLS auto fallback integration test so it covers the default client ALPN path
  • drain POST bodies in redirect test servers before close, avoiding Windows TCP resets with current Reseau

Root Cause

protocol=:auto attempted h2 with a default ALPN list of only ["h2"]. Some h1-only servers reject that during TLS with no_application_protocol before HTTP can observe an ALPN mismatch and run the existing h1 fallback.

The Windows CI failures on the first drafts resolved Reseau v1.1.3 and exposed unrelated test harness races: redirect test servers sent Connection: close responses for POST requests without draining the request body, which can reset the TCP connection on Windows.

Validation

  • julia --project=. --startup-file=no --history-file=no -e 'using Pkg; Pkg.test(; test_args=["http_integration_tests.jl", "http2_client_tests.jl"])' (test driver ran the full suite)
  • julia --project=. --startup-file=no --history-file=no test/http_client_tests.jl
  • julia --project=. --startup-file=no --history-file=no test/http_parity_tests.jl
  • live HTTP.jl gets 403 from endpoint while curl/Downloads succeeds with same URL and headers #1265 endpoint with default protocol=:auto returns 200 over HTTP/1.1

Refs #1265

Co-authored by Codex

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.53%. Comparing base (f9d62af) to head (9efb50b).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1269      +/-   ##
==========================================
+ Coverage   84.36%   84.53%   +0.16%     
==========================================
  Files          28       28              
  Lines       10689    10690       +1     
==========================================
+ Hits         9018     9037      +19     
+ Misses       1671     1653      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@quinnj quinnj force-pushed the codex/auto-alpn-fallback branch from d626d49 to 549a810 Compare June 1, 2026 14:02
@quinnj quinnj force-pushed the codex/auto-alpn-fallback branch from 549a810 to 9efb50b Compare June 1, 2026 14:14
@quinnj quinnj marked this pull request as ready for review June 1, 2026 14:27
@quinnj quinnj merged commit 83f4873 into master Jun 1, 2026
8 checks passed
@quinnj quinnj deleted the codex/auto-alpn-fallback branch June 1, 2026 14:27
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