Skip to content

Content-Encoding Header NOT omitted #299

@ryber

Description

@ryber

See #295

Unirest automatically deflates gzipped responses but does not remove the content-encoding header to reflect that the response is no longer zipped:

 @Test
    public void testGzipAsync() throws Exception {
        HttpResponse<RequestCapture> resp = Unirest.get(MockServer.GZIP)
                .queryString("zipme", "up")
                .asObjectAsync(RequestCapture.class)
                .get();

        resp.getBody()
                .assertParam("zipme", "up")
                .assertRequestHeader("Accept-Encoding", "gzip");

        assertEquals(0, resp.getHeaders().get("Content-Encoding").size());
    }

Metadata

Metadata

Assignees

Labels

BugOh Noes! A bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions