From 6c9f5e0910a41ea63768c3f1bcdf8bdf4a65c0b0 Mon Sep 17 00:00:00 2001 From: Szymon Marczak <36894700+szmarczak@users.noreply.github.com> Date: Sat, 29 Feb 2020 20:56:21 +0100 Subject: [PATCH] test #1021 --- test/cache.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/cache.ts b/test/cache.ts index 37f906dcd..13696b760 100644 --- a/test/cache.ts +++ b/test/cache.ts @@ -196,3 +196,17 @@ test('`isFromCache` stream property is true if the response was cached', withSer await getStream(stream); }); + +test('does not break POST requests', withServer, async (t, server, got) => { + server.post('/', async (request, response) => { + request.resume(); + response.end(JSON.stringify(request.headers)); + }); + + const headers = await got.post('', { + body: '', + cache: new Map() + }).json<{'content-length': string}>(); + + t.is(headers['content-length'], '0'); +});