Repository navigation
Commit 820b65c
committed
Allow the end-to-end test's host under DNS rebinding protection
## 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.1 parent 9d12f51 commit 820b65c
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
50 | 57 | | |
51 | 58 | | |
52 | 59 | | |
| |||
0 commit comments