fix(filter): capture x-mcp-method and x-mcp-name header variants - #291
Merged
Conversation
on_http_request_headers() previously only looked up the bare 'mcp-method' / 'mcp-name' headers. The MCP protocol also uses the 'x-mcp-method' / 'x-mcp-name' prefixed form (and clients sending 'X-MCP-Method' / 'MCP-Method' as documented in the milestone). proxy-wasm normalises header names to lowercase at the host boundary, so the lookup is case-insensitive once lowercased. This change adds a fallback chain: try 'x-mcp-method' first (prefixed form), then fall back to 'mcp-method'. Same pattern for mcp_name. No struct changes required (fields already exist). Existing tests pass unchanged; cargo build + cargo test green. Closes #79
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.
Closes #79
on_http_request_headers()now triesx-mcp-methodfirst, falls back tomcp-method. Same fallback formcp_name. proxy-wasm normalises headers to lowercase so bothX-MCP-MethodandMCP-Methodare handled.cargo build && cargo testgreen.