Modify metrics service endpoint (#3443)
This commit is contained in:
1 parent
685d8980c3
commit
c44f2869c9
1 file changed
+2
@@ -784,6 +784,8 @@ def add_api_key_middleware(app, api_key: str):
|
||||
return await call_next(request)
|
||||
if request.url.path.startswith("/health"):
|
||||
return await call_next(request)
|
||||
if request.url.path.startswith("/metrics"):
|
||||
return await call_next(request)
|
||||
if request.headers.get("Authorization") != "Bearer " + api_key:
|
||||
return ORJSONResponse(content={"error": "Unauthorized"}, status_code=401)
|
||||
return await call_next(request)
|
||||
|
||||
Reference in new issue
Block a user