Spaces:
Sleeping
Sleeping
updates app
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ app = FastAPI()
|
|
| 12 |
|
| 13 |
neural_searcher = NeuralSearcher(collection_name=COLLECTION_NAME)
|
| 14 |
|
| 15 |
-
ALLOWED_API_KEY = API_KEY
|
| 16 |
|
| 17 |
@app.get("/api/search")
|
| 18 |
async def search(q: str):
|
|
@@ -24,7 +24,6 @@ async def search(q: str):
|
|
| 24 |
@app.middleware("http")
|
| 25 |
async def api_key_authentication(request: Request, call_next):
|
| 26 |
api_key = request.headers.get("X-API-KEY")
|
| 27 |
-
print(api_key + "###" + str(ALLOWED_API_KEY))
|
| 28 |
if api_key != ALLOWED_API_KEY:
|
| 29 |
return JSONResponse(
|
| 30 |
status_code=403,
|
|
|
|
| 12 |
|
| 13 |
neural_searcher = NeuralSearcher(collection_name=COLLECTION_NAME)
|
| 14 |
|
| 15 |
+
ALLOWED_API_KEY = str(API_KEY)
|
| 16 |
|
| 17 |
@app.get("/api/search")
|
| 18 |
async def search(q: str):
|
|
|
|
| 24 |
@app.middleware("http")
|
| 25 |
async def api_key_authentication(request: Request, call_next):
|
| 26 |
api_key = request.headers.get("X-API-KEY")
|
|
|
|
| 27 |
if api_key != ALLOWED_API_KEY:
|
| 28 |
return JSONResponse(
|
| 29 |
status_code=403,
|