📝Add 'www_redirect' in TrustedHostMiddleware tutorial.

This commit is contained in:
Soul Lee 2024-04-15 20:43:37 +09:00
parent c94e31fdb0
commit 89d6a089ae
1 changed files with 1 additions and 1 deletions

View File

@ -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
)