From 546edb8038843903122fb9a671e7793b4ac74df5 Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Thu, 9 May 2024 13:08:36 +0200 Subject: [PATCH 1/2] Fix usage of deprecated util._extend() Node 22 dumps a deprecation warning when using `util._extend()`: ```js > (node:16870) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead. ```` --- lib/http-proxy/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http-proxy/index.js b/lib/http-proxy/index.js index 977a4b362..f42b14d53 100644 --- a/lib/http-proxy/index.js +++ b/lib/http-proxy/index.js @@ -1,5 +1,5 @@ var httpProxy = module.exports, - extend = require('util')._extend, + extend = Object.assign, // Avoids deprecation warning in Node22 for: require('util')._extend, parse_url = require('url').parse, EE3 = require('eventemitter3'), http = require('http'), From 475cb5a5d255e676b339e35e9560c855f93e04c0 Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Thu, 9 May 2024 13:11:52 +0200 Subject: [PATCH 2/2] Update common.js --- lib/http-proxy/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js index 6513e81d8..b2c148302 100644 --- a/lib/http-proxy/common.js +++ b/lib/http-proxy/common.js @@ -1,6 +1,6 @@ var common = exports, url = require('url'), - extend = require('util')._extend, + extend = Object.assign, // Avoids deprecation warning in Node22 for: require('util')._extend, required = require('requires-port'); var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i,