mirror of https://github.com/tiangolo/fastapi.git
Remove code examples for Python 3.8 in `advanced_middleware`
This commit is contained in:
parent
d990400c09
commit
0d064b6507
|
|
@ -57,13 +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.
|
||||
|
||||
{* ../../docs_src/advanced_middleware/tutorial001.py hl[2,6] *}
|
||||
{* ../../docs_src/advanced_middleware/tutorial001_py39.py hl[2,6] *}
|
||||
|
||||
## `TrustedHostMiddleware` { #trustedhostmiddleware }
|
||||
|
||||
Enforces that all incoming requests have a correctly set `Host` header, in order to guard against HTTP Host Header attacks.
|
||||
|
||||
{* ../../docs_src/advanced_middleware/tutorial002.py hl[2,6:8] *}
|
||||
{* ../../docs_src/advanced_middleware/tutorial002_py39.py hl[2,6:8] *}
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ Handles GZip responses for any request that includes `"gzip"` in the `Accept-Enc
|
|||
|
||||
The middleware will handle both standard and streaming responses.
|
||||
|
||||
{* ../../docs_src/advanced_middleware/tutorial003.py hl[2,6] *}
|
||||
{* ../../docs_src/advanced_middleware/tutorial003_py39.py hl[2,6] *}
|
||||
|
||||
The following arguments are supported:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from fastapi.testclient import TestClient
|
||||
|
||||
from docs_src.advanced_middleware.tutorial001 import app
|
||||
from docs_src.advanced_middleware.tutorial001_py39 import app
|
||||
|
||||
|
||||
def test_middleware():
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from fastapi.testclient import TestClient
|
||||
|
||||
from docs_src.advanced_middleware.tutorial002 import app
|
||||
from docs_src.advanced_middleware.tutorial002_py39 import app
|
||||
|
||||
|
||||
def test_middleware():
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from fastapi.responses import PlainTextResponse
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from docs_src.advanced_middleware.tutorial003 import app
|
||||
from docs_src.advanced_middleware.tutorial003_py39 import app
|
||||
|
||||
|
||||
@app.get("/large")
|
||||
|
|
|
|||
Loading…
Reference in New Issue