xss-req-sanitizer
v1.0.4
Published
Middleware to sanitize http requests
Downloads
19
Maintainers
Readme
xss-req-sanitizer
xss-req-sanitizer
is a middleware to sanitize http requests to prevent XSS attacks.
Installation
npm install xss-req-sanitizer
How to use ?
var express = require('express')
var bodyParser = require('body-parser')
var xssReqSanitizer = require('xss-req-sanitizer')
var app = express()
app.use(bodyParser.json())
// this should comes before any routes
app.use(xssReqSanitizer())
app.post('/your-route', (req, res) => {
// All the values from,
// req.body, req.params, req.query
// will be sanitized in-place.
})
Testing & Contributing
npm install
npm test