Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -79,7 +79,7 @@ def auto_fill(value: Optional[str], fallback: str) -> str:
|
|
79 |
@app.post("/analyze/")
|
80 |
async def analyze(data: ReviewInput, x_api_key: str = Header(None)):
|
81 |
if x_api_key and x_api_key != VALID_API_KEY:
|
82 |
-
|
83 |
if len(data.text.split()) < 20:
|
84 |
raise HTTPException(status_code=400, detail="⚠️ Review too short for analysis (min. 20 words).")
|
85 |
|
|
|
79 |
@app.post("/analyze/")
|
80 |
async def analyze(data: ReviewInput, x_api_key: str = Header(None)):
|
81 |
if x_api_key and x_api_key != VALID_API_KEY:
|
82 |
+
raise HTTPException(status_code=401, detail="❌ Invalid API key")
|
83 |
if len(data.text.split()) < 20:
|
84 |
raise HTTPException(status_code=400, detail="⚠️ Review too short for analysis (min. 20 words).")
|
85 |
|