add comment on why these are strings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user