We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug When using VersionedFastAPI all OPTIONS requests return a 405.
VersionedFastAPI
app = FastAPI(title='APP NAME') APP_VERSION = "1.1.1" app.add_middleware( CORSMiddleware, allow_origin_regex='https?://.*', allow_credentials=True, allow_methods=['*'], allow_headers=['*'], ) app.include_router(api_router_v1_0, prefix=config.API_V1_STR) app.include_router(api_router_v1_1, prefix=config.API_V1_STR) app = VersionedFastAPI(app)
To Reproduce Steps to reproduce the behavior:
Expected behavior Options request to pass as expected
The text was updated successfully, but these errors were encountered:
I had to add the middleware after Declaring the VersionedFastAPI. So this should hopefully fix it:
app = FastAPI(title='APP NAME') APP_VERSION = "1.1.1" app.include_router(api_router_v1_0, prefix=config.API_V1_STR) app.include_router(api_router_v1_1, prefix=config.API_V1_STR) app = VersionedFastAPI(app) app.add_middleware( CORSMiddleware, allow_origin_regex='https?://.*', allow_credentials=True, allow_methods=['*'], allow_headers=['*'], )
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When using
VersionedFastAPI
all OPTIONS requests return a 405.To Reproduce
Steps to reproduce the behavior:
VersionedFastAPI
Expected behavior
Options request to pass as expected
The text was updated successfully, but these errors were encountered: