Skip to content

Commit

Permalink
Remove trailing "/" when creating backend origin CORS urls
Browse files Browse the repository at this point in the history
The backend_cors_origin is a list[AnyHttpUrl] which, when transformed to str via str(origin), add a trailing slash. This messes up CORS in google chrome
  • Loading branch information
dominusmi committed May 23, 2024
1 parent 7f2fe0a commit 34123c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
app.add_middleware(
CORSMiddleware,
allow_origins=[
str(origin) for origin in get_settings().security.backend_cors_origins
str(origin).rstrip("/") for origin in get_settings().security.backend_cors_origins
],
allow_credentials=True,
allow_methods=["*"],
Expand Down

0 comments on commit 34123c6

Please sign in to comment.