chenhaoq87 commited on
Commit
09fb524
·
verified ·
1 Parent(s): 657a587

Simplify CORS to allow all origins

Browse files
Files changed (1) hide show
  1. fastapi_app.py +5 -5
fastapi_app.py CHANGED
@@ -21,14 +21,14 @@ app = FastAPI(
21
  version="1.0.0"
22
  )
23
 
24
- # Add CORS middleware - Allow requests from OpenAI and all origins
25
  app.add_middleware(
26
  CORSMiddleware,
27
- allow_origin_regex=r"https://.*\.openai\.com|https://chat\.openai\.com|https://.*",
28
- allow_credentials=False, # Changed to False for wildcard origins
29
- allow_methods=["GET", "POST", "OPTIONS"],
30
  allow_headers=["*"],
31
- expose_headers=["*"],
32
  )
33
 
34
  # Request/Response models
 
21
  version="1.0.0"
22
  )
23
 
24
+ # Add CORS middleware - Completely open for Custom GPT and all origins
25
  app.add_middleware(
26
  CORSMiddleware,
27
+ allow_origins=["*"],
28
+ allow_credentials=False,
29
+ allow_methods=["*"],
30
  allow_headers=["*"],
31
+ max_age=3600,
32
  )
33
 
34
  # Request/Response models