Skip to content

Commit d33f890

Browse files
committed
test: add --custom-headers test
1 parent cd6f037 commit d33f890

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Diff for: test/cli_spec.js

+25
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,29 @@ describe("CLI Tests", function() {
193193
});
194194
});
195195
});
196+
197+
it("custom-header", function(done) {
198+
var args = [
199+
'--ip', '127.0.0.1',
200+
'--ssl-cert', 'test/server.crt',
201+
'--ssl-key', 'test/server.key',
202+
'--port', port,
203+
'--default-target', testUrl,
204+
'--custom-header', 'k1: v1',
205+
'--custom-header', ' k2 : v2 v2 ',
206+
];
207+
executeCLI(execCmd, args).then((cliProcess) => {
208+
childProcess = cliProcess;
209+
r(SSLproxyUrl).then(body => {
210+
body = JSON.parse(body);
211+
expect(body.headers).toEqual(
212+
jasmine.objectContaining({
213+
k1: "v1",
214+
k2: "v2 v2",
215+
})
216+
);
217+
done();
218+
});
219+
});
220+
});
196221
});

0 commit comments

Comments
 (0)