expressjs / compression

Node.js compression middleware
MIT License
2.77k stars 241 forks source link

Testing with supertest always activates compression even with no request header #89

Closed ugolas closed 8 years ago

ugolas commented 8 years ago

Hi,

I've added the middleware without any special configurations, and am trying to test is using supertest.js.

In one test case I'm sending a POST request without specifying the 'Accept-Encoding' header, and still get in response the 'content-encoding' & 'transfer-encoding' headers.

Testing this in ARC/POSTMAN works as expected.

Any ideas?

blakeembrey commented 8 years ago

Superagent is probably adding the accept encoding header for you.

blakeembrey commented 8 years ago

Confirmed. I can see the header is set in superagent.