Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 94f07e6

Browse files
richardschneiderdryajov
authored andcommitted
test: fix HTTP weirdness test (#656)
* test: a work around for HTTP weirdness * test: consume the entire request, before responding
1 parent 834fc2d commit 94f07e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/request-api.spec.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ describe('\'deal with HTTP weirdness\' tests', () => {
1919
// go-ipfs always (currently) adds a content-type header, even if no content is present,
2020
// the standard behaviour for an http-api is to omit this header if no content is present
2121
const server = require('http').createServer((req, res) => {
22-
res.writeHead(200)
23-
res.end()
22+
// Consume the entire request, before responding.
23+
req.on('data', () => {})
24+
req.on('end', () => {
25+
res.writeHead(200)
26+
res.end()
27+
})
2428
})
2529

2630
server.listen(6001, () => {

0 commit comments

Comments
 (0)