Skip to content

Commit 1aa520e

Browse files
committed
fixing server backend
1 parent a65114f commit 1aa520e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

stringsight/api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,14 @@ def _resolve_df_and_method(
390390
# from fastapi.middleware.gzip import GZipMiddleware
391391
# app.add_middleware(GZipMiddleware, minimum_size=10000, compresslevel=1)
392392

393-
# Allow local Vite dev server by default - be permissive for development
393+
# CORS configuration - allow all origins for development and production
394394
app.add_middleware(
395395
CORSMiddleware,
396-
allow_origins=["*"], # Allow all origins for development
397-
allow_credentials=False, # Set to False when using allow_origins=["*"]
398-
allow_methods=["*"], # Allow all methods including OPTIONS
396+
allow_origins=["*"], # Allow all origins (cannot use with allow_credentials=True)
397+
allow_credentials=False, # Must be False when using allow_origins=["*"]
398+
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH"], # Explicitly allow all HTTP methods
399399
allow_headers=["*"], # Allow all headers
400+
expose_headers=["*"], # Expose all headers to frontend
400401
)
401402

402403
# Include metrics endpoints (basic file serving)

0 commit comments

Comments
 (0)