Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Feb 29, 2020
1 parent 2d46361 commit 6c9f5e0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

0 comments on commit 6c9f5e0

Please # to comment.