diff --git a/src/routes/network.js b/src/routes/network.js index 7a41ad69d..f2043df19 100644 --- a/src/routes/network.js +++ b/src/routes/network.js @@ -23,7 +23,6 @@ const assert = require('assert'), HttpError = require('connect-lastmile').HttpError, HttpSuccess = require('connect-lastmile').HttpSuccess, network = require('../network.js'), - reverseProxy = require('../reverseproxy.js'), safe = require('safetydance'); async function getBlocklist(req, res, next) { @@ -36,6 +35,7 @@ async function getBlocklist(req, res, next) { async function setBlocklist(req, res, next) { assert.strictEqual(typeof req.body, 'object'); + // this is a string to allow comments if (typeof req.body.blocklist !== 'string') return next(new HttpError(400, 'blocklist must be a string')); req.clearTimeout(); // can take a while if there is a lot of network ranges diff --git a/src/routes/reverseproxy.js b/src/routes/reverseproxy.js index cfeba7679..d2b9acfe1 100644 --- a/src/routes/reverseproxy.js +++ b/src/routes/reverseproxy.js @@ -25,6 +25,7 @@ async function getTrustedIps(req, res, next) { async function setTrustedIps(req, res, next) { assert.strictEqual(typeof req.body, 'object'); + // this is a string to allow comments if (typeof req.body.trustedIps !== 'string') return next(new HttpError(400, 'trustedIps must be a string')); const [error] = await safe(reverseProxy.setTrustedIps(req.body.trustedIps, AuditSource.fromRequest(req)));