fix: suppress Go transport headers in raw browser curl#101
Closed
fix: suppress Go transport headers in raw browser curl#101
Conversation
Made-with: Cursor
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: Changes appear to be in browser routing/curl handling, not in API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal) as specified in the filter. To monitor this PR anyway, reply with |
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
User-Agent: Go-http-client/1.1from reaching/curl/rawwhen callers did not explicitly set a user agentAccept-Encoding: gzipis not forwarded into ChromiumUser-AgentandAccept-EncodingheadersTest plan
go test ./lib/browserrouting ./...Made with Cursor
Note
Low Risk
Small, localized change to HTTP transport/header behavior with targeted tests; main risk is subtle header/encoding behavior differences for callers relying on Go defaults.
Overview
Raw
/curl/rawbrowser-egress requests no longer leak Go client defaults:NewHTTPClientnow clones*http.Transportwith compression disabled (avoiding implicitAccept-Encoding: gzip), andRoundTripexplicitly suppresses Go’s defaultUser-Agentwhen the caller didn’t set one.Adds tests verifying that implicit
User-Agent/Accept-Encodingare removed while explicitly provided values are preserved.Reviewed by Cursor Bugbot for commit 401aa38. Bugbot is set up for automated code reviews on this repo. Configure here.