R

Ravina • 3.59K Points
Extraordinary

Q. How can you restrict FastAPI CORS policy to specific origins?

  • (A) Set CORS-Restrict header
  • (B) Add allowed origins in CORSMiddleware
  • (C) Use allowed_cors parameter in app
  • (D) Set origin_policy in decorator
  • Correct Answer - Option(B)
  • Views: 6
  • Filed under category Fast API
  • Hashtags:

Explanation by: Ravina
Use `CORSMiddleware` and pass allowed origins via `allow_origins`.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.