mirror of
https://github.com/codelion/optillm.git
synced 2025-05-28 09:39:38 +03:00
Merge pull request #7 from sammcj/healthcheckkey
fix(healthcheck): dont require api key for /health
This commit is contained in:
@@ -56,6 +56,9 @@ known_approaches = ["mcts", "bon", "moa", "rto", "z3", "self_consistency", "pvg"
|
||||
@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
|
||||
|
||||
Reference in New Issue
Block a user