FastAPI - Middleware and Hooks
Consider the following FastAPI code snippet configuring CORS middleware:
What will be the effect of this CORS configuration on incoming requests?
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["https://myfrontend.com"],
allow_methods=["PUT", "DELETE"],
allow_headers=["Authorization"]
)What will be the effect of this CORS configuration on incoming requests?
