From e3908568aa02327d078c59ddba94ac9e3ff7cb3d Mon Sep 17 00:00:00 2001 From: Phillip9587 Date: Tue, 22 Oct 2024 09:49:55 +0200 Subject: [PATCH] remove `unpipe` package and use native `unpipe()` method --- HISTORY.md | 5 +++++ lib/read.js | 3 +-- package.json | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 8fb680fd..afd9c78d 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +unreleased +========================= + +* remove `unpipe` package and use native `unpipe()` method + 2.0.1 / 2024-09-10 ========================= diff --git a/lib/read.js b/lib/read.js index a4bd446d..1fa2b972 100644 --- a/lib/read.js +++ b/lib/read.js @@ -16,7 +16,6 @@ var destroy = require('destroy') var getBody = require('raw-body') var iconv = require('iconv-lite') var onFinished = require('on-finished') -var unpipe = require('unpipe') var zlib = require('zlib') /** @@ -96,7 +95,7 @@ function read (req, res, next, parse, debug, options) { // unpipe from stream and destroy if (stream !== req) { - unpipe(req) + req.unpipe() destroy(stream, true) } diff --git a/package.json b/package.json index cc6f7ab7..79a88826 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,7 @@ "on-finished": "2.4.1", "qs": "6.13.0", "raw-body": "^3.0.0", - "type-is": "~1.6.18", - "unpipe": "1.0.0" + "type-is": "~1.6.18" }, "devDependencies": { "eslint": "8.34.0",