getsentry / responses

A utility for mocking out the Python Requests library.
Apache License 2.0
4.17k stars 355 forks source link

fix mocked HEAD response when content-length header is present #712

Closed ddarricau closed 6 months ago

ddarricau commented 6 months ago

This PR is a fix for this issue https://github.com/getsentry/responses/issues/708. Basically when mocking a response to a HEAD request (which contains a content-length header), we do not pass the request_method. Which results in wrongfully raising a ChunkedEncodingError

markstory commented 6 months ago

Thank you 🎉