mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-10-13 16:33:20 +02:00
Backports #4843 from main. `get_http_headers()` now treats `cookie` as a credential header alongside `authorization`, so it is left out of the default mapping. The OpenAPI provider and the proxy transports build outgoing requests from that mapping, so their upstreams receive only the cookies the server configures itself: cookies or headers set on the OpenAPI `httpx` client, and cookie parameters the operation declares. Proxy transports continue to forward `Authorization`. `CurrentHeaders()` still includes both credential headers, since it exposes the current request to the handler. Code that calls `get_http_headers()` and needs the cookie can ask for it by name: ```python from fastmcp.server.dependencies import get_http_headers headers = get_http_headers(include={"cookie"}) ``` Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_bearer_auth_backend.py | ||
| test_custom_routes.py | ||
| test_http_auth_middleware.py | ||
| test_http_dependencies.py | ||
| test_http_middleware.py | ||
| test_sse_host_origin_protection.py | ||
| test_stale_access_token.py | ||
| test_streamable_http_shutdown.py | ||