Unverified Commit 355d4484 authored by Maikel van Dort's avatar Maikel van Dort Committed by GitHub

fix: deprecated util._extend (#89614)

### What?

Fix deprecated warning: "Use Object.assign instead of deprecated
util._extend" from http-proxy (which hasn't been updated for 5 years)

### Why?

### How?

Fixes #74460
In favour of https://github.com/vercel/next.js/pull/81544 (which didn't
use a patch, but manually updated the compiled version)
parent 7cd9c707
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
"@types/fs-extra": "8.1.0", "@types/fs-extra": "8.1.0",
"@types/glob": "7.1.1", "@types/glob": "7.1.1",
"@types/html-validator": "5.0.3", "@types/html-validator": "5.0.3",
"@types/http-proxy": "1.17.3", "@types/http-proxy": "1.17.17",
"@types/jest": "29.5.5", "@types/jest": "29.5.5",
"@types/node": "20.17.6", "@types/node": "20.17.6",
"@types/node-fetch": "2.6.1", "@types/node-fetch": "2.6.1",
...@@ -340,7 +340,8 @@ ...@@ -340,7 +340,8 @@
"stacktrace-parser@0.1.10": "patches/stacktrace-parser@0.1.10.patch", "stacktrace-parser@0.1.10": "patches/stacktrace-parser@0.1.10.patch",
"@types/node@20.17.6": "patches/@types__node@20.17.6.patch", "@types/node@20.17.6": "patches/@types__node@20.17.6.patch",
"taskr@1.1.0": "patches/taskr@1.1.0.patch", "taskr@1.1.0": "patches/taskr@1.1.0.patch",
"minizlib@3.1.0": "patches/minizlib@3.1.0.patch" "minizlib@3.1.0": "patches/minizlib@3.1.0.patch",
"http-proxy@1.18.1": "patches/http-proxy@1.18.1.patch"
} }
} }
} }
diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js
index 6513e81d80d5250ea249ea833f819ece67897c7e..486d4c896d65a3bb7cf63307af68facb3ddb886b 100644
--- a/lib/http-proxy/common.js
+++ b/lib/http-proxy/common.js
@@ -1,6 +1,5 @@
var common = exports,
url = require('url'),
- extend = require('util')._extend,
required = require('requires-port');
var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i,
@@ -40,10 +39,10 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
);
outgoing.method = options.method || req.method;
- outgoing.headers = extend({}, req.headers);
+ outgoing.headers = Object.assign({}, req.headers);
if (options.headers){
- extend(outgoing.headers, options.headers);
+ Object.assign(outgoing.headers, options.headers);
}
if (options.auth) {
diff --git a/lib/http-proxy/index.js b/lib/http-proxy/index.js
index 977a4b3622b9eaac27689f06347ea4c5173a96cd..88b2d0fcfa03c3aafa47c7e6d38e64412c45a7cc 100644
--- a/lib/http-proxy/index.js
+++ b/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--;
}
...@@ -28,6 +28,9 @@ patchedDependencies: ...@@ -28,6 +28,9 @@ patchedDependencies:
'@types/node@20.17.6': '@types/node@20.17.6':
hash: rvl3vkomen3tospgr67bzubfyu hash: rvl3vkomen3tospgr67bzubfyu
path: patches/@types__node@20.17.6.patch path: patches/@types__node@20.17.6.patch
http-proxy@1.18.1:
hash: qqiqxx62zlcu62nljjmhlvexni
path: patches/http-proxy@1.18.1.patch
minizlib@3.1.0: minizlib@3.1.0:
hash: o4nv5mg6kfnuzlknbdln3azhvu hash: o4nv5mg6kfnuzlknbdln3azhvu
path: patches/minizlib@3.1.0.patch path: patches/minizlib@3.1.0.patch
...@@ -187,8 +190,8 @@ importers: ...@@ -187,8 +190,8 @@ importers:
specifier: 5.0.3 specifier: 5.0.3
version: 5.0.3 version: 5.0.3
'@types/http-proxy': '@types/http-proxy':
specifier: 1.17.3 specifier: 1.17.17
version: 1.17.3 version: 1.17.17
'@types/jest': '@types/jest':
specifier: 29.5.5 specifier: 29.5.5
version: 29.5.5 version: 29.5.5
...@@ -362,7 +365,7 @@ importers: ...@@ -362,7 +365,7 @@ importers:
version: 5.1.18 version: 5.1.18
http-proxy: http-proxy:
specifier: 1.18.1 specifier: 1.18.1
version: 1.18.1 version: 1.18.1(patch_hash=qqiqxx62zlcu62nljjmhlvexni)
husky: husky:
specifier: 9.0.11 specifier: 9.0.11
version: 9.0.11 version: 9.0.11
...@@ -1517,7 +1520,7 @@ importers: ...@@ -1517,7 +1520,7 @@ importers:
version: 5.1.1 version: 5.1.1
http-proxy: http-proxy:
specifier: 1.18.1 specifier: 1.18.1
version: 1.18.1 version: 1.18.1(patch_hash=qqiqxx62zlcu62nljjmhlvexni)
http-proxy-agent: http-proxy-agent:
specifier: 5.0.0 specifier: 5.0.0
version: 5.0.0 version: 5.0.0
...@@ -6647,11 +6650,8 @@ packages: ...@@ -6647,11 +6650,8 @@ packages:
'@types/http-errors@2.0.4': '@types/http-errors@2.0.4':
resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==} resolution: {integrity: sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==}
'@types/http-proxy@1.17.16': '@types/http-proxy@1.17.17':
resolution: {integrity: sha512-sdWoUajOB1cd0A8cRRQ1cfyWNbmFKLAqBB89Y8x5iYyG/mkJHc0YUH8pdWBy2omi9qtCpiIgGjuwO0dQST2l5w==} resolution: {integrity: sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==}
'@types/http-proxy@1.17.3':
resolution: {integrity: sha512-wIPqXANye5BbORbuh74exbwNzj+UWCwWyeEFJzUQ7Fq3W2NSAy+7x7nX1fgbEypr2/TdKqpeuxLnXWgzN533/Q==}
'@types/inquirer@8.2.9': '@types/inquirer@8.2.9':
resolution: {integrity: sha512-5IEO2PwCy4NZDgj977dho4Qbdiw6dJZJzD4ZaB/9j7dfppf7z0xxFPKZz/FtTAUQbDjmWHJ6Jlz/gn0YzWHPsw==} resolution: {integrity: sha512-5IEO2PwCy4NZDgj977dho4Qbdiw6dJZJzD4ZaB/9j7dfppf7z0xxFPKZz/FtTAUQbDjmWHJ6Jlz/gn0YzWHPsw==}
...@@ -24078,11 +24078,7 @@ snapshots: ...@@ -24078,11 +24078,7 @@ snapshots:
'@types/http-errors@2.0.4': {} '@types/http-errors@2.0.4': {}
'@types/http-proxy@1.17.16': '@types/http-proxy@1.17.17':
dependencies:
'@types/node': 20.17.6(patch_hash=rvl3vkomen3tospgr67bzubfyu)
'@types/http-proxy@1.17.3':
dependencies: dependencies:
'@types/node': 20.17.6(patch_hash=rvl3vkomen3tospgr67bzubfyu) '@types/node': 20.17.6(patch_hash=rvl3vkomen3tospgr67bzubfyu)
...@@ -30019,8 +30015,8 @@ snapshots: ...@@ -30019,8 +30015,8 @@ snapshots:
http-proxy-middleware@2.0.7(@types/express@4.17.21): http-proxy-middleware@2.0.7(@types/express@4.17.21):
dependencies: dependencies:
'@types/http-proxy': 1.17.16 '@types/http-proxy': 1.17.17
http-proxy: 1.18.1 http-proxy: 1.18.1(patch_hash=qqiqxx62zlcu62nljjmhlvexni)
is-glob: 4.0.3 is-glob: 4.0.3
is-plain-obj: 3.0.0 is-plain-obj: 3.0.0
micromatch: 4.0.8 micromatch: 4.0.8
...@@ -30029,7 +30025,7 @@ snapshots: ...@@ -30029,7 +30025,7 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
http-proxy@1.18.1: http-proxy@1.18.1(patch_hash=qqiqxx62zlcu62nljjmhlvexni):
dependencies: dependencies:
eventemitter3: 4.0.7 eventemitter3: 4.0.7
follow-redirects: 1.9.0 follow-redirects: 1.9.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment