fix: disable MCP DNS rebinding protection for Docker/proxy deployment (fixes 421 Invalid Host header)
This commit is contained in:
@@ -122,7 +122,9 @@ _STATIC_COMPONENTS = [
|
|||||||
# streamable_http_path="/" so that when mounted at /mcp the endpoint is /mcp/
|
# streamable_http_path="/" so that when mounted at /mcp the endpoint is /mcp/
|
||||||
# stateless_http=True: each request is independent (no session management)
|
# stateless_http=True: each request is independent (no session management)
|
||||||
# Disable DNS rebinding protection for Docker deployment
|
# Disable DNS rebinding protection for Docker deployment
|
||||||
mcp = FastMCP("hms-cms", streamable_http_path="/", stateless_http=True)
|
from mcp.server.transport_security import TransportSecuritySettings
|
||||||
|
|
||||||
|
mcp = FastMCP("hms-cms", streamable_http_path="/", stateless_http=True, transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False))
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------#
|
# ---------------------------------------------------------------------------#
|
||||||
# Bearer token authentication wrapper
|
# Bearer token authentication wrapper
|
||||||
|
|||||||
Reference in New Issue
Block a user