Fix IP whitelisting
This commit is contained in:
parent
c8862c1a2a
commit
9933f7574e
1 changed files with 1 additions and 2 deletions
|
@ -20,14 +20,13 @@ const basicAuth = require('./basic-auth');
|
||||||
|
|
||||||
if (consts.ALLOWED_IPS) {
|
if (consts.ALLOWED_IPS) {
|
||||||
app.set('trust proxy', true);
|
app.set('trust proxy', true);
|
||||||
|
|
||||||
app.use(AccessControl({
|
app.use(AccessControl({
|
||||||
mode: 'allow',
|
mode: 'allow',
|
||||||
allows: consts.ALLOWED_IPS,
|
allows: consts.ALLOWED_IPS,
|
||||||
forceConnectionAddress: true,
|
|
||||||
statusCode: 404
|
statusCode: 404
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom Middleware
|
// Custom Middleware
|
||||||
app.use(logging);
|
app.use(logging);
|
||||||
app.use(basicAuth);
|
app.use(basicAuth);
|
||||||
|
|
Reference in a new issue