Skip to content

Instantly share code, notes, and snippets.

@alejandro
Created December 18, 2011 17:55
Show Gist options
  • Save alejandro/1494041 to your computer and use it in GitHub Desktop.
Save alejandro/1494041 to your computer and use it in GitHub Desktop.
var express = require('express')
var app = exports.app = express.createServer();
var fusker = require('fusker');
fusker.config.dir = process.cwd();
fusker.config.banLength = 1;
fusker.config.verbose = true;
fusker.http.detect('csrf', 'xss', 'sqli', 'lfi', '404');
fusker.http.punish('blacklist', 'bush');
fusker.socket.detect('xss', 'sqli', 'lfi');
fusker.socket.punish('blacklist');
app.configure(function() {
app.use(fusker.express.check);
//...
});
//...
app.all('/*', detectMobile, function(req, res, next) { //Line 468 <- throw error about PUSH
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
res.header('Strict-Transport-Security', 'max-age=31556926; includeSubDomains');
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment