moazx commited on
Commit
b26fe61
·
verified ·
1 Parent(s): 898dfc1

Update api/middleware.py

Browse files
Files changed (1) hide show
  1. api/middleware.py +4 -3
api/middleware.py CHANGED
@@ -148,6 +148,7 @@ def get_cors_middleware_config():
148
  # Include null for file:// protocol and common local development origins
149
  allowed_origins = [
150
  "https://moazx-api.hf.space",
 
151
  "http://localhost:8000",
152
  "http://127.0.0.1:8000",
153
  "http://localhost:5500", # Live Server default port
@@ -160,7 +161,7 @@ def get_cors_middleware_config():
160
  return {
161
  "allow_origins": allowed_origins,
162
  "allow_credentials": True,
163
- "allow_methods": ["*"],
164
- "allow_headers": ["*"],
165
- "expose_headers": ["*"],
166
  }
 
148
  # Include null for file:// protocol and common local development origins
149
  allowed_origins = [
150
  "https://moazx-api.hf.space",
151
+ "https://huggingface.co",
152
  "http://localhost:8000",
153
  "http://127.0.0.1:8000",
154
  "http://localhost:5500", # Live Server default port
 
161
  return {
162
  "allow_origins": allowed_origins,
163
  "allow_credentials": True,
164
+ "allow_methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
165
+ "allow_headers": ["Content-Type", "Authorization", "Accept", "Origin", "X-Requested-With", "Cookie"],
166
+ "expose_headers": ["Set-Cookie"],
167
  }