diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js index 06856f2..a6aca80 100644 --- a/lib/http-proxy/common.js +++ b/lib/http-proxy/common.js @@ -31,8 +31,8 @@ common.setupOutgoing = function(outgoing, options, req, forward) { function(e) { outgoing[e] = options[forward || 'target'][e]; } ); - outgoing.method = req.method - outgoing.headers = extend({},req.headers) + outgoing.method = req.method; + outgoing.headers = extend({}, req.headers); if (options.headers){ extend(outgoing.headers, options.headers); diff --git a/test/lib-http-proxy-common-test.js b/test/lib-http-proxy-common-test.js index c4edaf6..149c422 100644 --- a/test/lib-http-proxy-common-test.js +++ b/test/lib-http-proxy-common-test.js @@ -156,7 +156,7 @@ describe('lib/http-proxy/common.js', function () { expect(outgoing.method).to.eql('i'); expect(outgoing.path).to.eql('am'); - expect(outgoing.headers.pro).to.eql('xy') + expect(outgoing.headers.pro).to.eql('xy'); expect(outgoing.port).to.eql(443); });