Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -57,9 +57,9 @@ async def translate(req: TranslationRequest, request: Request):
|
|
| 57 |
raise HTTPException(status_code=403, detail="Unauthorized API key")
|
| 58 |
|
| 59 |
# ---- Optional IP restriction ----
|
| 60 |
-
client_ip = request.client.host
|
| 61 |
-
if ALLOWED_IPS and client_ip not in ALLOWED_IPS:
|
| 62 |
-
|
| 63 |
|
| 64 |
|
| 65 |
# always set source language
|
|
|
|
| 57 |
raise HTTPException(status_code=403, detail="Unauthorized API key")
|
| 58 |
|
| 59 |
# ---- Optional IP restriction ----
|
| 60 |
+
#client_ip = request.client.host
|
| 61 |
+
#if ALLOWED_IPS and client_ip not in ALLOWED_IPS:
|
| 62 |
+
# raise HTTPException(status_code=403, detail="IP not allowed")
|
| 63 |
|
| 64 |
|
| 65 |
# always set source language
|