Skip to content

Commit f98f5f3

Browse files
committed
docs: say which same-origin redirects are followed (307/308) in the Redirects section and recap
1 parent 9dc7b84 commit f98f5f3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎docs/client/transports.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ environment variables or pass an explicit `verify=ssl_context` to your `httpx2.A
8282

8383
The transport connects to the URL you gave it, and only that origin.
8484

85-
* A redirect that stays on the same scheme, host and port is followed. That covers the usual `/mcp` → `/mcp/` trailing-slash redirect, and `http://` → `https://` on the same host.
85+
* A `307`/`308` redirect that stays on the same scheme, host and port is followed, and so is `http://` → `https://` on the same host. That covers the usual `/mcp` → `/mcp/` trailing-slash redirect.
8686
* A redirect anywhere else is **not** followed. The call fails with:
8787

8888
```text
@@ -136,7 +136,7 @@ A **transport** is any async context manager that yields a `(read, write)` pair
136136
* `Client(mcp)` (the server object) connects in memory. Use it for tests and for embedding.
137137
* `Client("http://.../mcp")` (a URL) connects over Streamable HTTP, the production transport.
138138
* Headers, auth, proxies and timeouts belong on an `httpx2.AsyncClient` you pass to `streamable_http_client(url, http_client=...)`. There is no `headers=` keyword.
139-
* Redirects are followed only within the URL's own origin (trailing slash, `http`→`https`). Anything else fails with `Redirect to … not followed`; configure the final URL.
139+
* Redirects are followed only within the URL's own origin (a trailing-slash `307`/`308`), plus `http`→`https` on the same host. Anything else fails with `Redirect to … not followed`; configure the final URL.
140140
* stdio is `Client(StdioServerParameters(...))`. Wrap it in `stdio_client(...)` yourself only to redirect the child's stderr.
141141
* The subprocess gets an allow-listed environment, not yours; `env=` adds to it.
142142
* A transport is anything you can `async with x as (read, write)`. `Client` hands anything that isn't a server object, a URL or `StdioServerParameters` straight to that protocol.

0 commit comments

Comments
 (0)