xss-req-sanitizer

1.0.4 • Public • Published

xss-req-sanitizer

Build Status Coverage Status

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

License

MIT

Package Sidebar

Install

npm i xss-req-sanitizer

Weekly Downloads

21

Version

1.0.4

License

MIT

Unpacked Size

4.44 kB

Total Files

5

Last publish

Collaborators

  • kalekarnn