diff --git a/test/gzip.js b/test/gzip.js index 4aeba09..33f17bc 100644 --- a/test/gzip.js +++ b/test/gzip.js @@ -31,6 +31,13 @@ test.before('setup', async () => { res.end('Not gzipped content'); }); + s.on('/missing-data', (req, res) => { + res.statusCode = 200; + res.setHeader('Content-Type', 'text/plain'); + res.setHeader('Content-Encoding', 'gzip'); + zlib.gzip(testContent, (_, data) => res.end(data.slice(0, -1))); + }); + await s.listen(s.port); }); @@ -61,6 +68,10 @@ test('do not break HEAD responses', async t => { t.is((await got.head(s.url)).body, ''); }); +test('ignore missing data', async t => { + t.is((await got(`${s.url}/missing-data`)).body, testContent); +}); + test.after('cleanup', async () => { await s.close(); });