fix(healthcheck): dont require api key for /health

This commit is contained in:
Sam
2024-09-16 09:00:11 +10:00
parent 242dc8c7c3
commit 344528593a

View File

@@ -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