Skip to content

Instantly share code, notes, and snippets.

@deepal
Last active October 14, 2019 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save deepal/664697195f9bf188f38b to your computer and use it in GitHub Desktop.
Save deepal/664697195f9bf188f38b to your computer and use it in GitHub Desktop.
nodesec-manual-headers
var express = require('express');
var app = express();
app.disable('x-powered-by'); // disable X-Powered-By header
app.use(function(req, res, next){
res.header('X-XSS-Protection', '1; mode=block');
res.header('X-Frame-Options', 'deny');
res.header('X-Content-Type-Options', 'nosniff');
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment