Skip to content

Encoding is messed up with AutoInflate #535

@ixti

Description

@ixti

When requesting a resource with auto_inflate feature on, encoding of body most certainly will be messed up.

To reproduce:

HTTP.use(:auto_inflate).headers("Accept-Encoding" => "gzip").get(url)

url in the above is some URL that returns response with headers like this:

Content-Type: application/json; charset=utf-8
Content-Encoding: gzip

in this example, encoding of the body will be Encoding::BINARY. Even worse, if you pass :encoding => Encoding::UTF_8 explicitly when calling #get it won't be respected at the end.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions