util._extend() is depracatory

Author: aristocracyCreated Jul 24, 2026Updated Jul 24, 2026

Hi!

Firstly, thanks for your work on this project!

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff
diff --git a/node_modules/http-proxy/lib/http-proxy/index.js b/node_modules/http-proxy/lib/http-proxy/index.js
index 977a4b3..88b2d0f 100644
--- a/node_modules/http-proxy/lib/http-proxy/index.js
+++ b/node_modules/http-proxy/lib/http-proxy/index.js
@@ -1,5 +1,4 @@
 var httpProxy = module.exports,
-    extend    = require('util')._extend,
     parse_url = require('url').parse,
     EE3       = require('eventemitter3'),
     http      = require('http'),
@@ -47,9 +46,9 @@ function createRightProxy(type) {
         args[cntr] !== res
       ) {
         //Copy global options
-        requestOptions = extend({}, options);
+        requestOptions = Object.assign({}, options);
         //Overwrite with request options
-        extend(requestOptions, args[cntr]);
+        Object.assign(requestOptions, args[cntr]);
 
         cntr--;
       }

This issue body was partially generated by patch-package.

Source: http-party/node-http-proxy