mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-15 18:25:18 +02:00
fix(backend): always allow localhost CORS for desktop app
This commit is contained in:
parent
d4ad5c7fe4
commit
8cf12db72a
1 changed files with 6 additions and 10 deletions
|
|
@ -340,16 +340,12 @@ if config.NEXT_FRONTEND_URL:
|
||||||
if www_url not in allowed_origins:
|
if www_url not in allowed_origins:
|
||||||
allowed_origins.append(www_url)
|
allowed_origins.append(www_url)
|
||||||
|
|
||||||
# For local development, also allow common localhost origins
|
allowed_origins.extend(
|
||||||
if not config.BACKEND_URL or (
|
[ # For local development and desktop app
|
||||||
config.NEXT_FRONTEND_URL and "localhost" in config.NEXT_FRONTEND_URL
|
|
||||||
):
|
|
||||||
allowed_origins.extend(
|
|
||||||
[
|
|
||||||
"http://localhost:3000",
|
"http://localhost:3000",
|
||||||
"http://127.0.0.1:3000",
|
"http://127.0.0.1:3000",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue