Skip to content

✨(api) add support for CORS#629

Open
piptouque wants to merge 1 commit intoopenfun:mainfrom
piptouque:feat_add_cors_middleware
Open

✨(api) add support for CORS#629
piptouque wants to merge 1 commit intoopenfun:mainfrom
piptouque:feat_add_cors_middleware

Conversation

@piptouque
Copy link

Purpose

Closes #628 .

Proposal

  • Add CORSMiddleware to the FastAPI's server with appropriate config.
  • Add a runserver setting for a list of allowed origins
  • Add some tests for the above setting's validation
  • Add preflight requests tests I don't think it is possible with pytest as the CORS settings are loaded when the server starts and can't be changed afterwards.

Use FastAPI's CORS middleware,
and add configurable
allowed origins.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for CORS preflight requests

1 participant