Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update main.py
Browse files
main.py
CHANGED
@@ -99,7 +99,8 @@ app = FastAPI()
|
|
99 |
@app.post("/webhook")
|
100 |
async def webhook(request: Request):
|
101 |
logger.info(f"Received webhook request from {request.client.host}")
|
102 |
-
|
|
|
103 |
if request.headers.get("X-Webhook-Secret") not in {MODEL_CATALOG_WEBHOOK_SECRET, SIMSHIP_WEBHOOK_SECRET}:
|
104 |
logger.warning("Invalid webhook secret received")
|
105 |
return Response("Invalid secret", status_code=401)
|
|
|
99 |
@app.post("/webhook")
|
100 |
async def webhook(request: Request):
|
101 |
logger.info(f"Received webhook request from {request.client.host}")
|
102 |
+
if not MODEL_CATALOG_WEBHOOK_SECRET:
|
103 |
+
logger.warning("MODEL_CATALOG_WEBHOOK_SECRET is not set")
|
104 |
if request.headers.get("X-Webhook-Secret") not in {MODEL_CATALOG_WEBHOOK_SECRET, SIMSHIP_WEBHOOK_SECRET}:
|
105 |
logger.warning("Invalid webhook secret received")
|
106 |
return Response("Invalid secret", status_code=401)
|