Repository navigation
Allow the end-to-end test's host under DNS rebinding protection - #614
Merged
koic merged 1 commit intoOct 15, 2026
Conversation
## Motivation and Context `MCP::Server::OAuth::EndToEndTest` drives the SDK's HTTP client against a Rack stack through WebMock's `to_rack`, which until WebMock 3.32 passed the app no `Host` header. WebMock 3.34.0 fills `HTTP_HOST` in from the request URL, so the transport's DNS rebinding protection, on by default, now refuses `mcp.example.com` with `403 Forbidden: Invalid Host header`, and the test errors with "You are forbidden to make initialize requests" on every CI run since that release. The test now builds the transport with `allowed_hosts: ["mcp.example.com"]`, as a deployment serving that host would, so it passes with either WebMock. The library is unchanged. ## How Has This Been Tested? `test/mcp/server/oauth/end_to_end_test.rb` with WebMock 3.34.0, where it errored before, and with WebMock 3.26.4, where it passed before and still does. ## Breaking Changes None.
koic
deleted the
allow_the_end_to_end_host_under_dns_rebinding_protection
branch
October 15, 2026 08:23
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.
Motivation and Context
MCP::Server::OAuth::EndToEndTestdrives the SDK's HTTP client against a Rack stack through WebMock'sto_rack, which until WebMock 3.32 passed the app noHostheader. WebMock 3.34.0 fillsHTTP_HOSTin from the request URL, so the transport's DNS rebinding protection, on by default, now refusesmcp.example.comwith403 Forbidden: Invalid Host header, and the test errors with "You are forbidden to make initialize requests" on every CI run since that release.The test now builds the transport with
allowed_hosts: ["mcp.example.com"], as a deployment serving that host would, so it passes with either WebMock. The library is unchanged.How Has This Been Tested?
test/mcp/server/oauth/end_to_end_test.rbwith WebMock 3.34.0, where it errored before, and with WebMock 3.26.4, where it passed before and still does.Breaking Changes
None.
Types of changes
Checklist