Spaces:
Sleeping
Sleeping
referer
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ app.add_middleware(
|
|
108 |
|
109 |
@app.middleware("http")
|
110 |
async def validate_origin(request: Request, call_next):
|
111 |
-
if request.headers.get("
|
112 |
raise HTTPException(status_code=403, detail="Forbidden")
|
113 |
response = await call_next(request)
|
114 |
return response
|
|
|
108 |
|
109 |
@app.middleware("http")
|
110 |
async def validate_origin(request: Request, call_next):
|
111 |
+
if request.headers.get("referer") not in origins and not DEV:
|
112 |
raise HTTPException(status_code=403, detail="Forbidden")
|
113 |
response = await call_next(request)
|
114 |
return response
|