undici
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -443,2 +443,7 @@ 'use strict' | ||
if (length === 1) { | ||
// https://github.com/mcollina/undici/issues/269 | ||
this.socket._unrefTimer() | ||
} | ||
assert(statusCode >= 200) | ||
@@ -445,0 +450,0 @@ |
{ | ||
"name": "undici", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "An HTTP/1.1 client, written from scratch for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -334,7 +334,9 @@ 'use strict' | ||
test('basic POST with custom stream', (t) => { | ||
t.plan(8) | ||
t.plan(4) | ||
const expected = Buffer.alloc(2000000).toString() | ||
const server = createServer(postServer(t, expected + expected)) | ||
const server = createServer((req, res) => { | ||
req.resume().on('end', () => { | ||
res.end('hello') | ||
}) | ||
}) | ||
t.tearDown(server.close.bind(server)) | ||
@@ -351,5 +353,2 @@ | ||
method: 'POST', | ||
headers: { | ||
'content-length': Buffer.byteLength(expected) * 2 | ||
}, | ||
requestTimeout: 0, | ||
@@ -377,5 +376,7 @@ body | ||
body.emit('data', '') | ||
body.emit('data', expected) | ||
while (!client[kSocket]._writableState.needDrain) { | ||
body.emit('data', Buffer.alloc(4096)) | ||
} | ||
client[kSocket].on('drain', () => { | ||
body.emit('data', expected) | ||
body.emit('data', Buffer.alloc(4096)) | ||
body.emit('close') | ||
@@ -382,0 +383,0 @@ }) |
250502
8126