node防xss攻击插件

var xss = require('node-xss').clean;
router.post("/orders/insert-orders", function (req, res) {
//对请求体做xss过滤
var data = xss(req.body); var url = urlMap.englishlistenspeakserver + '/orders/insert-orders'; var options = { url: url, method: 'POST', json: true, qs: data }; request(options, function (error, response, body) { res.send(body); }) });

 

转载于:https://www.cnblogs.com/kakayang/p/8242709.html

你可能感兴趣的:(node防xss攻击插件)