module.exports.handleRecalc = (req, res, next) => { if (req.method === 'POST' && req.url.includes('application/recalculate')) { const recalcStructure = structureService.recalc(req.body); res.send(recalcStructure); } else { next(); } };
I tried to add the following lines in the method: <pre lang="Javascript"> const sanitizedReqBody = expAutoSan.sanitizeIt(req.body); const recalcStructure = structureService.recalc(sanitizedReqBody);
const expAutoSan = require('express-autosanitizer');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)