Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,10 +99,13 @@ app = FastAPI(title="HackRX RAG Server", lifespan=lifespan)
|
|
| 99 |
|
| 100 |
# --- 3. API Key Verification ---
|
| 101 |
TEAM_API_KEY = os.getenv("TEAM_API_KEY")
|
|
|
|
| 102 |
def verify_api_key(authorization: str = Header(...)):
|
| 103 |
if not authorization.startswith("Bearer "):
|
| 104 |
raise HTTPException(status_code=401, detail="Invalid Authorization header format")
|
| 105 |
token = authorization.split("Bearer ")[1]
|
|
|
|
|
|
|
| 106 |
if token != TEAM_API_KEY:
|
| 107 |
raise HTTPException(status_code=403, detail="Invalid or missing API key")
|
| 108 |
|
|
|
|
| 99 |
|
| 100 |
# --- 3. API Key Verification ---
|
| 101 |
TEAM_API_KEY = os.getenv("TEAM_API_KEY")
|
| 102 |
+
|
| 103 |
def verify_api_key(authorization: str = Header(...)):
|
| 104 |
if not authorization.startswith("Bearer "):
|
| 105 |
raise HTTPException(status_code=401, detail="Invalid Authorization header format")
|
| 106 |
token = authorization.split("Bearer ")[1]
|
| 107 |
+
print(token)
|
| 108 |
+
print(TEAM_API_KEY)
|
| 109 |
if token != TEAM_API_KEY:
|
| 110 |
raise HTTPException(status_code=403, detail="Invalid or missing API key")
|
| 111 |
|