Repository navigation
feat: support transparent-headers - #207
Merged
iFurySt merged 5 commits intoJul 16, 2025
Merged
Conversation
Contributor
Reviewer's GuideAdds support for user-defined “transparent” headers by propagating them from MCP arguments into outgoing HTTP requests, introducing a new helper for merging headers, extending server initialization and configuration to pass through a “transparentHeadersArgName,” and updating the CLI entrypoint and YAML schema accordingly. Sequence diagram for propagating transparent headers in HTTP tool executionsequenceDiagram
participant Client
participant Server
participant HTTPTool
Client->>Server: Call tool with args (including transparent headers)
Server->>Server: transferTransparentHeaderArgs(args, request)
Server->>HTTPTool: Prepare HTTP request (headers merged)
HTTPTool-->>Server: HTTP response
Server-->>Client: Tool result (response)
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @qiankunli - I've reviewed your changes - here's some feedback:
- Extract the hard-coded header whitelist in prepareRequest into a package-level constant or configurable variable to avoid duplicating header names.
- Add defensive type checks and error returns in transferTransparentHeaderArgs to handle unexpected argument shapes instead of assuming map[string]any and avoid potential panics.
- Consider refactoring the two header-setting flows (template headers and transparent headers) into a single unified helper to reduce duplication and improve maintainability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Extract the hard-coded header whitelist in prepareRequest into a package-level constant or configurable variable to avoid duplicating header names.
- Add defensive type checks and error returns in transferTransparentHeaderArgs to handle unexpected argument shapes instead of assuming map[string]any and avoid potential panics.
- Consider refactoring the two header-setting flows (template headers and transparent headers) into a single unified helper to reduce duplication and improve maintainability.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
qiankunli
force-pushed
the
feat/support-transparent-headers
branch
from
July 16, 2025 08:48
9bc9431 to
ee5cd9c
Compare
iFurySt
force-pushed
the
feat/support-transparent-headers
branch
from
July 16, 2025 12:41
4c2b342 to
c98e83a
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 by Sourcery
Support transparent header forwarding in HTTP tools by introducing a configurable argument key, refactoring header processing, and augmenting logging for better visibility.
New Features:
Enhancements:
Documentation: