Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
nodesec-hpp
var hpp = require('hpp');
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.urlencoded({extended: false})); //body parser should be placed before using hpp
app.use(hpp());
app.get('/', function(req, res, next){
console.log('Query Parameters : ' + JSON.stringify(req.query));
console.log('Polluted Query Parameters : '+ JSON.stringify(req.queryPolluted));
res.render('index');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.