Skip to content

Commit 410a8ce

Browse files
committed
[test] add proper failing test case for #738
1 parent d98d951 commit 410a8ce

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/lib-http-proxy-common-test.js

+15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var common = require('../lib/http-proxy/common'),
2+
url = require('url'),
23
expect = require('expect.js');
34

45
describe('lib/http-proxy/common.js', function () {
@@ -211,6 +212,20 @@ describe('lib/http-proxy/common.js', function () {
211212

212213
expect(outgoing.path).to.eql('/forward/?foo=bar//&target=http://foobar.com/?a=1%26b=2&other=2');
213214
})
215+
216+
//
217+
// This is the proper failing test case for the common.join problem
218+
//
219+
it('should correctly format the a toProxy URL', function () {
220+
var outgoing = {};
221+
var google = 'https://google.com'
222+
common.setupOutgoing(outgoing, {
223+
target: url.parse('http://sometarget.com:80'),
224+
toProxy: true,
225+
}, { url: google });
226+
227+
expect(outgoing.path).to.eql('/' + google);
228+
})
214229
});
215230

216231
describe('#setupSocket', function () {

0 commit comments

Comments
 (0)