Browse Source
commitpull/14015/head3e2dbf9169Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 19:34:37 2025 +0000 📝 Update release notes [skip ci] commitf5b77ff0fcAuthor: Sebastián Ramírez <[email protected]> Date: Sun Aug 31 21:34:08 2025 +0200 📝 Add documentation for Behind a Proxy - Proxy Forwarded Headers, using `--forwarded-allow-ips="*"` (#14028) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit176cd8c9efAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 15:20:12 2025 +0000 📝 Update release notes [skip ci] commit1884d76f61Author: Sebastián Ramírez <[email protected]> Date: Sun Aug 31 17:19:49 2025 +0200 🔧 Update sponsors: remove Platform.sh (#14027) commit8062aabdaaAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 15:02:29 2025 +0000 📝 Update release notes [skip ci] commitee9ccac1e5Author: Sebastián Ramírez <[email protected]> Date: Sun Aug 31 17:02:08 2025 +0200 🔧 Update sponsors: remove Mobb (#14026) commit5cd4c3b6bdAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 10:59:17 2025 +0000 📝 Update release notes [skip ci] commit4584f706bdAuthor: Jom Karlo Verzosa <[email protected]> Date: Sun Aug 31 18:58:56 2025 +0800 📝 Add deprecation info block about `dict()` in `docs/tutorial/body.md` (#13906) Co-authored-by: Sebastián Ramírez <[email protected]> commitba9c8fba0bAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 10:50:12 2025 +0000 📝 Update release notes [skip ci] commitd9249c1949Author: Valentyn <[email protected]> Date: Sun Aug 31 06:49:48 2025 -0400 📝 Fix Twitter to be X (Twitter) everywhere in documentation (#13809) Co-authored-by: Valentyn Druzhynin <[email protected]> Co-authored-by: Sebastián Ramírez <[email protected]> commita973e787afAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 10:33:32 2025 +0000 📝 Update release notes [skip ci] commit1088d2abd9Author: Ashish Pandey <[email protected]> Date: Sun Aug 31 16:17:57 2025 +0545 🐛 Prevent scroll-to-top on restart/fast buttons in `termynal.js` (#13714) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit98ec6a6079Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 10:29:48 2025 +0000 📝 Update release notes [skip ci] commit6b4d292f3aAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 10:29:27 2025 +0000 📝 Update release notes [skip ci] commitd4ddcc5878Author: z0z0r4 <[email protected]> Date: Sun Aug 31 18:29:21 2025 +0800 📝 Update testing events documentation (#13259) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Motov Yurii <[email protected]> Co-authored-by: Sebastián Ramírez <[email protected]> commit0e5832aa6dAuthor: Hotah Ma <[email protected]> Date: Sun Aug 31 18:29:01 2025 +0800 📝 Remove obsolete `url` field in error responses in docs (#13655) Co-authored-by: Motov Yurii <[email protected]> commitee2acd8abcAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 10:03:35 2025 +0000 📝 Update release notes [skip ci] commite902ed5fc6Author: Arnaud Durand <[email protected]> Date: Sun Aug 31 12:03:10 2025 +0200 📝 Bring the `scope` claim in line with the standard in `docs_src/security/tutorial005.py` (#11189) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Yurii Motov <[email protected]> commitcef1f166dfAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 09:59:28 2025 +0000 📝 Update release notes [skip ci] commit8e63f75919Author: Soul Lee <[email protected]> Date: Sun Aug 31 18:59:07 2025 +0900 📝 Update TrustedHostMiddleware Documentation (#11441) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alejandra <[email protected]> Co-authored-by: Sofie Van Landeghem <[email protected]> Co-authored-by: Sebastián Ramírez <[email protected]> Co-authored-by: Motov Yurii <[email protected]> commite1b9cc00caAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 09:56:48 2025 +0000 📝 Update release notes [skip ci] commit408b8a9bebAuthor: Denny Biasiolli <[email protected]> Date: Sun Aug 31 11:56:21 2025 +0200 📝 Remove links to site callbackhell.com that doesn't exist anymore (#14006) commit0817c955ecAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 09:16:03 2025 +0000 📝 Update release notes [skip ci] commitc55f7138a1Author: Motov Yurii <[email protected]> Date: Sun Aug 31 11:15:41 2025 +0200 📝 Add permalinks to headers in English docs (#13993) Co-authored-by: Sebastián Ramírez <[email protected]> commit7653de2715Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sun Aug 31 09:11:36 2025 +0000 📝 Update release notes [skip ci] commit784f068abaAuthor: Sebastián Ramírez <[email protected]> Date: Sun Aug 31 11:11:15 2025 +0200 🛠️ Update `mkdocs_hooks` to handle headers with permalinks when building docs (#14025) Co-authored-by: Yurii Motov <[email protected]> commit6db05770f6Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Mon Aug 25 20:03:24 2025 +0000 📝 Update release notes [skip ci] commit6be02e3d52Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Aug 25 22:03:02 2025 +0200 ⬆ [pre-commit.ci] pre-commit autoupdate (#14016) updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.9 → v0.12.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.9...v0.12.10) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commit9cf7b70d7bAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Wed Aug 20 09:11:20 2025 +0000 📝 Update release notes [skip ci] commitf75c1532f6Author: Motov Yurii <[email protected]> Date: Wed Aug 20 11:10:51 2025 +0200 ⬆ Bump `mkdocs-macros-plugin` from 1.3.7 to 1.3.9 (#14003) Bump mkdocs-macros-plugin from 1.3.7 to 1.3.9 commit5c3a70d5b6Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Mon Aug 18 21:07:25 2025 +0000 📝 Update release notes [skip ci] commit6a45249303Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon Aug 18 23:07:04 2025 +0200 ⬆ [pre-commit.ci] pre-commit autoupdate (#13999) updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.8 → v0.12.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.8...v0.12.9) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> commitc23051682bAuthor: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Mon Aug 18 06:35:06 2025 +0000 📝 Update release notes [skip ci] commitdf779885faAuthor: Mika <[email protected]> Date: Mon Aug 18 14:34:40 2025 +0800 📝 Fix code include for Pydantic models example in `docs/zh/docs/python-types.md` (#13997) Updated the Pydantic expiration example in the Chinese documentation
5 changed files with 165 additions and 4 deletions
@ -0,0 +1,8 @@ |
|||
from fastapi import FastAPI |
|||
|
|||
app = FastAPI() |
|||
|
|||
|
|||
@app.get("/items/") |
|||
def read_items(): |
|||
return ["plumbus", "portal gun"] |
|||
@ -0,0 +1,21 @@ |
|||
from fastapi.testclient import TestClient |
|||
|
|||
from docs_src.behind_a_proxy.tutorial001_01 import app |
|||
|
|||
client = TestClient( |
|||
app, |
|||
base_url="https://example.com", |
|||
follow_redirects=False, |
|||
) |
|||
|
|||
|
|||
def test_redirect() -> None: |
|||
response = client.get("/items") |
|||
assert response.status_code == 307 |
|||
assert response.headers["location"] == "https://example.com/items/" |
|||
|
|||
|
|||
def test_no_redirect() -> None: |
|||
response = client.get("/items/") |
|||
assert response.status_code == 200 |
|||
assert response.json() == ["plumbus", "portal gun"] |
|||
Loading…
Reference in new issue