|
| 1 | +diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js |
| 2 | +index 6513e81d80d5250ea249ea833f819ece67897c7e..486d4c896d65a3bb7cf63307af68facb3ddb886b 100644 |
| 3 | +--- a/lib/http-proxy/common.js |
| 4 | ++++ b/lib/http-proxy/common.js |
| 5 | +@@ -1,6 +1,5 @@ |
| 6 | + var common = exports, |
| 7 | + url = require('url'), |
| 8 | +- extend = require('util')._extend, |
| 9 | + required = require('requires-port'); |
| 10 | + |
| 11 | + var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i, |
| 12 | +@@ -40,10 +39,10 @@ common.setupOutgoing = function(outgoing, options, req, forward) { |
| 13 | + ); |
| 14 | + |
| 15 | + outgoing.method = options.method || req.method; |
| 16 | +- outgoing.headers = extend({}, req.headers); |
| 17 | ++ outgoing.headers = Object.assign({}, req.headers); |
| 18 | + |
| 19 | + if (options.headers){ |
| 20 | +- extend(outgoing.headers, options.headers); |
| 21 | ++ Object.assign(outgoing.headers, options.headers); |
| 22 | + } |
| 23 | + |
| 24 | + if (options.auth) { |
| 25 | +diff --git a/lib/http-proxy/index.js b/lib/http-proxy/index.js |
| 26 | +index 977a4b3622b9eaac27689f06347ea4c5173a96cd..88b2d0fcfa03c3aafa47c7e6d38e64412c45a7cc 100644 |
| 27 | +--- a/lib/http-proxy/index.js |
| 28 | ++++ b/lib/http-proxy/index.js |
| 29 | +@@ -1,5 +1,4 @@ |
| 30 | + var httpProxy = module.exports, |
| 31 | +- extend = require('util')._extend, |
| 32 | + parse_url = require('url').parse, |
| 33 | + EE3 = require('eventemitter3'), |
| 34 | + http = require('http'), |
| 35 | +@@ -47,9 +46,9 @@ function createRightProxy(type) { |
| 36 | + args[cntr] !== res |
| 37 | + ) { |
| 38 | + //Copy global options |
| 39 | +- requestOptions = extend({}, options); |
| 40 | ++ requestOptions = Object.assign({}, options); |
| 41 | + //Overwrite with request options |
| 42 | +- extend(requestOptions, args[cntr]); |
| 43 | ++ Object.assign(requestOptions, args[cntr]); |
| 44 | + |
| 45 | + cntr--; |
| 46 | + } |
0 commit comments