Skip to content

GZip content not automatically being deflated #562

@KNejad

Description

@KNejad

When making a HTTParty GZipped request with Accept-Encoding set to gzip, deflate I would expect HTTParty to automatically un-GZip the response. What I am seeing is content which is still GZipped.

To reproduce

Create HTTParty get request with Accept-Encoding set to gzip, deflate as below

r = HTTParty.get("https://example.com", {headers: { "Accept-Encoding" => "gzip, deflate"}})
r.body => # Still GZipped content

Expected result

r = HTTParty.get("https://example.com", {headers: { "Accept-Encoding" => "gzip, deflate"}})
r.body => # Plain text content

This is related to post I created on campaignmonitor/createsend-ruby#58 where they are doing the above.

Edit: The response body has to be over 1KB for the compressions to kick in. Which is where the bug appears

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions