-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
A HEAD request to any supported endpoint (eg HEAD /tm) will return the response body as if it were a GET which is slightly against the intended behaviour of HEAD (which should still return headers but no body)
Example test that can expose this for tests/integration/general/test_api.py
@pytest.mark.parametrize(
"uri", [uri for methods, uri in ALL_ENDPOINTS_WITH_SUPPORTED_METHODS if HTTPMethod.HEAD in methods]
)
@pytest.mark.anyio
async def test_head_has_no_response_body(uri: str, client: AsyncClient, valid_headers: dict):
response = await client.request(method=HTTPMethod.GET.name, url=uri, headers=valid_headers)
assert_response_header(response, HTTPStatus.OK, expected_content_type=None)
assert not read_response_body_string(response)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers