Package Exports
- sql-sanitizer
- sql-sanitizer/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sql-sanitizer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sql-sanitizer
Here the express module detects SQL injection attacks and stops them by sending 403 as a response. The module checks the query string, route parameters, and body for any SQL injection-related contents.
let app = express();
let sqlSanitizer = require('sql-sanitizer');
app.use(sqlSanitizer);
Installation
$ npm install sql-sanitizer
Usage
Example:
let express = require('express');
let app = express();
let sqlSanitizer = require('sql-sanitizer');
app.use(sqlSanitizer);
app.post('/route1', (req, res) => {
res.status(200).send({});
});
app.get('/route2/:uid', (req, res) => {
res.status(200).send({});
});
app.post('/route3', (req, res) => {
res.status(200).send({});
});
app.listen(4000);