add comment on why these are strings

This commit is contained in:
Girish Ramakrishnan
2023-09-09 07:57:53 +05:30
parent 20a4136eb5
commit 8880d46dd5
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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