Skip to content

Commit c6f3ecd

Browse files
author
kanhaiya
committed
Fix process kill and added env for proxy v1
1 parent 447ed29 commit c6f3ecd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/tunnel.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,20 +469,15 @@ function killRunningProcess_(that, fnCallback) {
469469
if (that.proc && that.infoAPIPort) {
470470
var url = 'http://127.0.0.1:' + that.infoAPIPort + '/api/v1.0/stop';
471471
var parseURL = urlParse.parse(url);
472-
var data = '';
473472
var reqOptions = {
474473
hostname: parseURL.hostname,
475474
port: parseURL.port,
476475
path: parseURL.path,
477-
method: 'DELETE',
478-
headers: {
479-
'Content-Type': 'application/json',
480-
'x-ml-auth': 'LambdaTest',
481-
'Content-Length': data.length
482-
}
476+
method: 'DELETE'
483477
};
484478

485479
var req = http.request(reqOptions, resp => {
480+
resp.on('data', () => {})
486481
resp.on('end', () => {
487482
if (resp.statusCode != 200) {
488483
killProcess_(that, fnCallback);
@@ -502,7 +497,7 @@ function killRunningProcess_(that, fnCallback) {
502497
);
503498
return fnCallback(e);
504499
});
505-
req.write(data);
500+
req.write('');
506501
req.end();
507502
} else {
508503
return fnCallback();

0 commit comments

Comments
 (0)