Spaces:
Running
on
T4
Running
on
T4
Commit
·
b80a82c
1
Parent(s):
beaf86b
modified app.py
Browse files
app.py
CHANGED
|
@@ -130,7 +130,7 @@ async def shutdown_db():
|
|
| 130 |
# -------------------------------------------------
|
| 131 |
# 🔐 Global Auth Middleware
|
| 132 |
# -------------------------------------------------
|
| 133 |
-
PUBLIC_PATHS = ["/
|
| 134 |
|
| 135 |
API_SECRET_TOKEN = os.getenv("API_SECRET_TOKEN")
|
| 136 |
if not API_SECRET_TOKEN:
|
|
@@ -139,7 +139,7 @@ if not API_SECRET_TOKEN:
|
|
| 139 |
@fastapi_app.middleware("http")
|
| 140 |
async def auth_middleware(request: Request, call_next):
|
| 141 |
path = request.url.path
|
| 142 |
-
if
|
| 143 |
return await call_next(request)
|
| 144 |
|
| 145 |
auth_header = request.headers.get("Authorization")
|
|
|
|
| 130 |
# -------------------------------------------------
|
| 131 |
# 🔐 Global Auth Middleware
|
| 132 |
# -------------------------------------------------
|
| 133 |
+
PUBLIC_PATHS = ["/health"]
|
| 134 |
|
| 135 |
API_SECRET_TOKEN = os.getenv("API_SECRET_TOKEN")
|
| 136 |
if not API_SECRET_TOKEN:
|
|
|
|
| 139 |
@fastapi_app.middleware("http")
|
| 140 |
async def auth_middleware(request: Request, call_next):
|
| 141 |
path = request.url.path
|
| 142 |
+
if path in PUBLIC_PATHS: # exact match
|
| 143 |
return await call_next(request)
|
| 144 |
|
| 145 |
auth_header = request.headers.get("Authorization")
|