fix(health): support HEAD method for health endpoint

This commit is contained in:
2025-11-22 11:54:06 -07:00
parent 65d5dfdbd6
commit 9dfa77633a
6 changed files with 588 additions and 2 deletions

View File

@@ -60,6 +60,15 @@ class TestHealthEndpoint:
assert response.status_code == 200
def test_health_check_head_method(self, test_app):
"""Test health check endpoint supports HEAD requests."""
with TestClient(test_app) as client:
response = client.head("/health")
assert response.status_code == 200
# HEAD requests should not have a response body
assert len(response.content) == 0
def test_root_endpoint(self, test_app):
"""Test root endpoint returns service information."""
client = TestClient(test_app)