util._extend() is depracatory
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- javascript, node.js
Research direction
Update lib/http-proxy/index.js, where util._extend is required and used to copy proxy options. Compare the provided diff with the surrounding request-option handling, then run the existing test suite to confirm the proxy behavior is unchanged and the deprecated utility is no longer used.
Written by the indexing model from the issue text.
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch http-proxy@1.18.1 for the project I'm working on.
Here is the diff that solved my problem:
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.
- Dominant language
- JavaScript
- Stars
- 14.1k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from http-party/node-http-proxy
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
http-party/node-http-proxy#1721 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
http-party/node-http-proxy#1715 · 1 comment · 5 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 15/100
http-party/node-http-proxy#1711 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
http-party/node-http-proxy#1710 · 5 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
http-party/node-http-proxy#1708 · 1 comment ·
All issues in http-party/node-http-proxy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·
-
client-controller-update ta-bot-triage team-money-movement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MetaMask/metamask-mobile#36594 ·