Skip to content

Request recorder forgets to record content type #770

@dwt

Description

@dwt

Looking at [the source of the recorder[(https://github.com/getsentry/responses/blob/9ea86fe6af7626e7b270e128b1e8c521c013d948/responses/_recorder.py#L150C39-L156C10), it does not record the content_type of the actual request, and instead synthesizes [it to "text/plain; charset=utf-8" instead]("text/plain; charset=utf-8").

This is wrong, as we loose the content_type image/tiff that the server sends and which we require.

Hour workaround is fairly ugly right now, and looks approximately like this:

        if (len(responses.registered())>2 and
                responses.registred()[1].url.endswith("something_specific")):
            responses.registered()[1].content_type="image/tiff"

We would be happy to provide a pull request, please indicate if you would like to take it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions