]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update includes in `docs/en/docs/advanced/middleware.md` (#12582)
authorGraziano Montanaro <40232320+montanarograziano@users.noreply.github.com>
Sun, 27 Oct 2024 16:45:50 +0000 (17:45 +0100)
committerGitHub <noreply@github.com>
Sun, 27 Oct 2024 16:45:50 +0000 (16:45 +0000)
docs/en/docs/advanced/middleware.md

index 07deac716e04bd3430d10d030e1896b3de29900a..3faf3fbf91dca20cff82d1825e93edbe9773df19 100644 (file)
@@ -57,17 +57,13 @@ Enforces that all incoming requests must either be `https` or `wss`.
 
 Any incoming request to `http` or `ws` will be redirected to the secure scheme instead.
 
-```Python hl_lines="2  6"
-{!../../docs_src/advanced_middleware/tutorial001.py!}
-```
+{* ../../docs_src/advanced_middleware/tutorial001.py hl[2,6] *}
 
 ## `TrustedHostMiddleware`
 
 Enforces that all incoming requests have a correctly set `Host` header, in order to guard against HTTP Host Header attacks.
 
-```Python hl_lines="2  6-8"
-{!../../docs_src/advanced_middleware/tutorial002.py!}
-```
+{* ../../docs_src/advanced_middleware/tutorial002.py hl[2,6:8] *}
 
 The following arguments are supported:
 
@@ -81,9 +77,7 @@ Handles GZip responses for any request that includes `"gzip"` in the `Accept-Enc
 
 The middleware will handle both standard and streaming responses.
 
-```Python hl_lines="2  6"
-{!../../docs_src/advanced_middleware/tutorial003.py!}
-```
+{* ../../docs_src/advanced_middleware/tutorial003.py hl[2,6] *}
 
 The following arguments are supported: