]> git.ipfire.org Git - thirdparty/starlette.git/commit
Use `localhost` instead of `http://localhost` in `TestClient(client=...)` example...
authorWilliam David Edwards <WEdwards@cyberfusion.nl>
Sun, 16 Feb 2025 10:44:10 +0000 (11:44 +0100)
committerGitHub <noreply@github.com>
Sun, 16 Feb 2025 10:44:10 +0000 (07:44 -0300)
commit16959423f1aeb48910f57d359782577f02647b29
treedfa573124a694944135b053b929c0d00dd7110d4
parenta7d0b14c7378aa2e95b0b13583fe0dadace363be
Use `localhost` instead of `http://localhost` in `TestClient(client=...)` example (#2870)

With https://github.com/encode/starlette/pull/2810, it is possible to override the client host (i.e. the remote address; see https://www.starlette.io/requests/#client-address).

The default value for `TestClient` is `testclient`, but an IP address in most circumstances.

The documentation example for overriding the client host uses a full URI, which makes no sense: it's the remote address.
docs/testclient.md