Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces case-insensitive header merging and overriding in the HTTP tool. It replaces direct map copying with a new mergeHeaders helper function that canonicalizes header keys using http.CanonicalHeaderKey. Additionally, it adds comprehensive unit tests to verify header precedence and case-insensitive overrides. No review comments were provided, so I have no feedback to address.
This branch has not been deployed
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.
Description
Fixes #4416.
HTTP header names with different casing survived source/tool/parameter merges as separate map keys. They were canonicalized only when setting the request headers, so map iteration could let a lower-priority value replace an override. Canonicalize names as each layer is merged, preserving source < tool < provided parameter precedence and existing values/parameter behavior.
Validation on Go 1.27.3 (darwin/arm64):
go test -race -p=2 -count=1 -v -cover ./internal/tools/http, including a real HTTP source, tool invocation and local receiver. Package coverage increases from 35.2% to 69.4%.go vet, golangci-lint 2.15.0 and its goimports formatter pass.go.mod/go.sumare unchanged.Repository-wide checks, the authenticated Google fixture and full MCP endpoint tests were not run.
PR Checklist