getsentry / responses

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

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

Closed ddarricau closed 2 months ago

ddarricau commented 2 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 2 months ago

Thank you 🎉