Skip to content

Commit c7cdfa0

Browse files
committed
test: update pipeline expectation for framed client requests
A client request that writes a payload is now framed with a chunked Transfer-Encoding. When the body source is destroyed before EOF the request ends without its terminating chunk, so the peer resets the connection instead of seeing a clean close, and the echoed response fails with ECONNRESET rather than ERR_STREAM_PREMATURE_CLOSE. Signed-off-by: Avocado <ujubongbong@gmail.com>
1 parent 8d8a358 commit c7cdfa0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎test/parallel/test-stream-pipeline.js‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,10 @@ tmpdir.refresh();
271271
{
272272
const server = http.createServer(common.mustCallAtLeast((req, res) => {
273273
pipeline(req, res, common.mustCall((err) => {
274-
// The client destroys the request body source before EOF below, so the
275-
// echoed response cannot finish successfully either.
276-
assert.strictEqual(err?.code, 'ERR_STREAM_PREMATURE_CLOSE');
274+
// The client destroys the request body source before EOF below. The
275+
// request is framed as chunked, so it ends without its terminating
276+
// chunk and the connection is reset rather than closed cleanly.
277+
assert.strictEqual(err?.code, 'ECONNRESET');
277278
}));
278279
}));
279280

0 commit comments

Comments
 (0)