Browse Source

add test on head method with gzip decoding

See #145
http2
Vsevolod Strukchinsky 9 years ago
parent
commit
16a6e08b11
  1. 10
      test/gzip.js

10
test/gzip.js

@ -14,6 +14,12 @@ test.before('setup', async t => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.setHeader('Content-Encoding', 'gzip');
if (req.method === 'HEAD') {
res.end();
return;
}
zlib.gzip(testContent, (_, data) => res.end(data));
});
@ -46,6 +52,10 @@ test('preserve headers property', async t => {
t.ok((await got(s.url)).headers);
});
test('do not break HEAD responses', async t => {
t.is((await got.head(s.url)).body, '');
});
test.after('cleanup', async t => {
await s.close();
});

Loading…
Cancel
Save