fix: bump fhttp to include HTTP/2 POST body fix#416
Open
akagomez wants to merge 2 commits intoDanny-Dasilva:mainfrom
Open
fix: bump fhttp to include HTTP/2 POST body fix#416akagomez wants to merge 2 commits intoDanny-Dasilva:mainfrom
akagomez wants to merge 2 commits intoDanny-Dasilva:mainfrom
Conversation
f889c4b to
76f5da4
Compare
Adds tests that verify POST/PUT/PATCH body transmission over HTTP/2 to a server with strict flow control settings (initialWindowSize: 16384). These tests FAIL on the current codebase because AutoUpdate() in fhttp does not set InitialWindowSize for Chrome/Firefox navigators, causing connection-level flow control to start at 0. All body writes block in awaitFlowControl() and DATA frames are never sent. To reproduce: npm install npx jest tests/http2-post-body.test.ts --forceExit Expected: 4 failed (expected 200, received 408)
Updates fhttp from v0.0.0-20240217 to v0.0.0-20260106 which adds the missing InitialWindowSize assignment in AutoUpdate() for Chrome and Firefox navigators. This fixes the 4 failing tests from the previous commit. To verify: npm install cd src && go build -o ../dist/index-mac-arm64 . && cd .. npx jest tests/http2-post-body.test.ts --forceExit Expected: 4 passed
76f5da4 to
083eb59
Compare
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
Updates
fhttpfromv0.0.0-20240217tov0.0.0-20260106to fix HTTP/2 POST/PUT/PATCH body transmission for Chrome and Firefox navigators.Problem
AutoUpdate()infhttp/http2/transport.gosetsHeaderTableSizeandMaxHeaderListSizefor Chrome/Firefox navigators but does not setInitialWindowSize. This leaves it at 0, socc.flow.add(int32(0))gives the connection-level flow window zero capacity. All body writes block inawaitFlowControl()and DATA frames are never sent.The
defaultnavigator case correctly setsInitialWindowSize = initialWindowSize. The fix adds the same assignment to the Chrome and Firefox cases.Servers with strict HTTP/2 flow control send
RST_STREAM CANCELwhen the body never arrives. Lenient servers happen to tolerate the missing flow control.Reproduction
This PR has two commits for easy verification:
Commit 1 (
e3f5b38) adds tests only — no fix. They fail:git checkout e3f5b38 npm install npx jest tests/http2-post-body.test.ts --forceExit # Result: 4 failed (expected 200, received 408)Commit 2 (
083eb59) bumps fhttp — tests pass:Tests
The tests start a local HTTPS server with strict HTTP/2 settings (
initialWindowSize: 16384) and verify form-encoded POST, JSON POST, PUT, and PATCH bodies are transmitted correctly.Changes
tests/http2-post-body.test.ts— new test filecycletls/go.mod— bump fhttpsrc/go.mod— same (indirect)go.sumfiles updatedAll existing Go tests pass with the updated dependency.