From 344528593adb43e805d076161d5ffeeecd01e64d Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 16 Sep 2024 09:00:11 +1000 Subject: [PATCH] fix(healthcheck): dont require api key for /health --- optillm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/optillm.py b/optillm.py index f6d81344..803635bf 100644 --- a/optillm.py +++ b/optillm.py @@ -56,6 +56,9 @@ @app.before_request def check_api_key(): if server_config['api_key']: + if request.path == "/health": + return + auth_header = request.headers.get('Authorization') if not auth_header or not auth_header.startswith('Bearer '): return jsonify({"error": "Invalid Authorization header. Expected format: 'Authorization: Bearer YOUR_API_KEY'"}), 401