diff --git a/test/lib-http-proxy-common-test.js b/test/lib-http-proxy-common-test.js index ef99ca109..58233f754 100644 --- a/test/lib-http-proxy-common-test.js +++ b/test/lib-http-proxy-common-test.js @@ -251,7 +251,7 @@ describe('lib/http-proxy/common.js', function () { expect(outgoing.path).to.eql('/' + google); }); - + it('should not replace :\ to :\\ when no http word before', function () { var outgoing = {}; var google = 'http://google.com:/join/join.js' @@ -262,7 +262,7 @@ describe('lib/http-proxy/common.js', function () { expect(outgoing.path).to.eql('/' + google); }); - + describe('when using ignorePath', function () { it('should ignore the path of the `req.url` passed in but use the target path', function () { var outgoing = {}; @@ -347,6 +347,16 @@ describe('lib/http-proxy/common.js', function () { expect(outgoing.secureProtocol).eql('my-secure-protocol'); }); + it('should handle overriding the `method` of the http request', function () { + var outgoing = {}; + common.setupOutgoing(outgoing, { + target: url.parse('https://whooooo.com'), + method: 'POST' , + }, { method: 'GET', url: '' }); + + expect(outgoing.method).eql('POST'); + }); + // url.parse('').path => null it('should not pass null as last arg to #urlJoin', function(){ var outgoing = {};