mirror of https://github.com/tiangolo/fastapi.git
📝Add 'www_redirect' in TrustedHostMiddleware tutorial.
This commit is contained in:
parent
c94e31fdb0
commit
89d6a089ae
|
|
@ -4,7 +4,7 @@ from fastapi.middleware.trustedhost import TrustedHostMiddleware
|
|||
app = FastAPI()
|
||||
|
||||
app.add_middleware(
|
||||
TrustedHostMiddleware, allowed_hosts=["example.com", "*.example.com"]
|
||||
TrustedHostMiddleware, allowed_hosts=["example.com", "*.example.com"], www_redirect=True
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue