fastmcp/tests
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
..
cli Add CIMD (Client ID Metadata Document) support for OAuth (#2871) 2026-02-06 13:44:52 -05:00
client Add CIMD (Client ID Metadata Document) support for OAuth (#2871) 2026-02-06 13:44:52 -05:00
contrib Add session-specific visibility control via Context (#2917) 2026-01-18 22:31:06 -05:00
deprecated Rename Enabled transform to Visibility (#2950) 2026-01-19 20:46:58 -05:00
experimental Unify SamplingHandler and promote OpenAI handler (#2616) 2025-12-14 15:22:43 -05:00
fs Add standalone decorators and eliminate fastmcp.fs module (#2832) 2026-01-10 12:16:35 -05:00
integration_tests Refactor OAuthProxy into focused modules (#2935) 2026-01-19 10:10:07 -05:00
prompts Fix Field() handling in prompts (#3050) 2026-02-01 21:28:44 -05:00
resources Fix Field() handling in prompts (#3050) 2026-02-01 21:28:44 -05:00
server Exclude content-type header from get_http_headers() to prevent HTTP 415 errors (#3104) 2026-02-06 20:19:36 -05:00
telemetry Address Jeremiah's telemetry feedback 2026-01-14 09:45:41 -05:00
tools Fix compress_schema to preserve additionalProperties: false for MCP compatibility (#3102) 2026-02-06 18:52:21 -05:00
utilities Fix compress_schema to preserve additionalProperties: false for MCP compatibility (#3102) 2026-02-06 18:52:21 -05:00
__init__.py Update type handling for resources 2024-11-29 19:42:46 -05:00
conftest.py Consolidate test fixtures and refactor large test files (#2941) 2026-01-19 15:18:35 -05:00
test_apps.py MCP Apps: structured CSP/permissions types, resource meta propagation fix, QR example (#3031) 2026-01-30 14:05:25 -05:00
test_json_schema_generation.py fix: use SkipJsonSchema to exclude callable fields from JSON schema generation (#3048) 2026-02-01 21:30:48 -05:00
test_mcp_config.py Fix test_multi_client_with_logging to filter OpenTelemetry logs 2026-01-14 09:45:41 -05:00