mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-06 22:32:39 +02:00
Merge pull request #1343 from MODSetter/fix/app-py-changes
feat: add CORS preflight response caching for 24 hours
This commit is contained in:
commit
e5c00221c8
1 changed files with 6 additions and 0 deletions
|
|
@ -754,6 +754,12 @@ app.add_middleware(
|
||||||
allow_credentials=True,
|
allow_credentials=True,
|
||||||
allow_methods=["*"], # Allows all methods
|
allow_methods=["*"], # Allows all methods
|
||||||
allow_headers=["*"], # Allows all headers
|
allow_headers=["*"], # Allows all headers
|
||||||
|
# Cache CORS preflight (OPTIONS) responses for 24h. Browsers clamp:
|
||||||
|
# Chrome/Edge cap at 7200s, Firefox honours up to 86400s. Setting the
|
||||||
|
# higher value lets each browser cache for as long as it allows. This
|
||||||
|
# eliminates an OPTIONS round-trip on every non-simple request from
|
||||||
|
# FRONTEND_URL to BACKEND_URL.
|
||||||
|
max_age=86400,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Password / email-based auth routers are only mounted when not running in
|
# Password / email-based auth routers are only mounted when not running in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue