Skip to content

Commit

Permalink
Disable basic auth for health check & Remove trailing space
Browse files Browse the repository at this point in the history
  • Loading branch information
gnuletik committed Mar 20, 2018
1 parent 5a1a884 commit 4861bfa
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var yargs = require('yargs')
})
.option('l', {
alias: 'limit',
default: process.env.LIMIT || '10000kb',
default: process.env.LIMIT || '10000kb',
demand: false,
describe: 'request limit'
})
Expand Down Expand Up @@ -120,17 +120,21 @@ function getCredentials(req, res, next) {
else return next();
});
}
var proxy = httpProxy.createProxyServer({

var options = {
target: TARGET,
changeOrigin: true,
secure: true
});
};

var app = express();
app.use(compress());
if (argv.u && argv.a) {
app.use(basicAuth(argv.u, argv.a));
options['auth'] = argv.u + ':' + argv.a;
}

var proxy = httpProxy.createProxyServer(options);

var app = express();
app.use(compress());
app.use(bodyParser.raw({limit: REQ_LIMIT, type: function() { return true; }}));
app.use(getCredentials);

Expand Down

0 comments on commit 4861bfa

Please sign in to comment.