make auditsource a class

this allows us to use AuditSource for the class and auditSource for
the instances!
This commit is contained in:
Girish Ramakrishnan
2021-09-30 09:50:30 -07:00
parent 339fdfbea1
commit 445c83c8b9
22 changed files with 138 additions and 131 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ exports = module.exports = {
};
const assert = require('assert'),
auditSource = require('../auditsource.js'),
AuditSource = require('../auditsource.js'),
BoxError = require('../boxerror.js'),
HttpError = require('connect-lastmile').HttpError,
HttpSuccess = require('connect-lastmile').HttpSuccess,
@@ -27,7 +27,7 @@ async function setBlocklist(req, res, next) {
req.clearTimeout(); // can take a while if there is a lot of network ranges
const [error] = await safe(network.setBlocklist(req.body.blocklist, auditSource.fromRequest(req)));
const [error] = await safe(network.setBlocklist(req.body.blocklist, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, {}));