fastmcp/tests/server/http
Jeremiah Lowin d12d46b049
Exclude content-type header from get_http_headers() to prevent HTTP 415 errors (#3104)
Fixes #3097

When using FastMCP.from_openapi() with APIs that require specific
Content-Type headers (e.g., application/vnd.api+json), the transport
connection's content-type: application/json was being injected into
downstream API requests, causing HTTP 415 (Unsupported Media Type) errors.

This change adds content-type to the exclude_headers set in get_http_headers(),
similar to how accept is already excluded. The MCP transport's content type
has no relevance to downstream API calls and should not be forwarded.

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Jeremiah Lowin <jlowin@users.noreply.github.com>
2026-02-06 20:19:36 -05:00
..
__init__.py clean up test inits 2025-05-31 19:32:08 -04:00
test_bearer_auth_backend.py Add loq file size limits and clean up type ignores (#2859) 2026-01-13 07:29:12 -05:00
test_custom_routes.py Internal refactor of MCP handlers (#2005) 2025-10-05 08:45:10 -04:00
test_http_auth_middleware.py Make CORS opt-in via middleware parameter (#2150) 2025-10-20 15:33:13 -04:00
test_http_dependencies.py Exclude content-type header from get_http_headers() to prevent HTTP 415 errors (#3104) 2026-02-06 20:19:36 -05:00
test_http_middleware.py Fix type errors for ty 0.0.1-alpha.31 upgrade (#2561) 2025-12-05 21:29:14 -05:00
test_stale_access_token.py Fix get_access_token() returning stale token after OAuth refresh (#2505) 2025-12-01 10:51:02 -05:00