No need to pull in underscore to build an object

This commit is contained in:
Johannes Zellner
2018-08-13 22:01:51 +02:00
parent 7f5fe12712
commit 00041add55

View File

@@ -8,8 +8,7 @@ exports = module.exports = {
var assert = require('assert'),
config = require('./config.js'),
debug = require('debug')('box:ldap'),
http = require('http'),
_ = require('underscore');
http = require('http');
var gServer = null;
@@ -27,7 +26,14 @@ function start(callback) {
if (interceptor(req, res)) return;
// rejectUnauthorized should not be required but it doesn't work without it
var options = _.extend({ }, { socketPath: '/var/run/docker.sock' }, { method: req.method, path: req.url, headers: req.headers, rejectUnauthorized: false });
var options = {
socketPath: '/var/run/docker.sock',
method: req.method,
path: req.url,
headers: req.headers,
rejectUnauthorized: false
};
var dockerRequest = http.request(options, function (dockerResponse) {
res.writeHead(dockerResponse.statusCode, dockerResponse.headers);
dockerResponse.on('error', console.error);