Standard JS code conversion + fixes

This commit is contained in:
NGPixel
2017-02-08 20:52:37 -05:00
parent a508b2a7f4
commit 414dc386d6
54 changed files with 4022 additions and 4288 deletions

View File

@@ -1,3 +1,5 @@
'use strict'
/**
* Security Middleware
*
@@ -6,23 +8,21 @@
* @param {Function} next next callback function
* @return {any} void
*/
module.exports = function(req, res, next) {
module.exports = function (req, res, next) {
// -> Disable X-Powered-By
app.disable('x-powered-by')
//-> Disable X-Powered-By
app.disable('x-powered-by');
// -> Disable Frame Embedding
res.set('X-Frame-Options', 'deny')
//-> Disable Frame Embedding
res.set('X-Frame-Options', 'deny');
// -> Re-enable XSS Fitler if disabled
res.set('X-XSS-Protection', '1; mode=block')
//-> Re-enable XSS Fitler if disabled
res.set('X-XSS-Protection', '1; mode=block');
// -> Disable MIME-sniffing
res.set('X-Content-Type-Options', 'nosniff')
//-> Disable MIME-sniffing
res.set('X-Content-Type-Options', 'nosniff');
// -> Disable IE Compatibility Mode
res.set('X-UA-Compatible', 'IE=edge')
//-> Disable IE Compatibility Mode
res.set('X-UA-Compatible', 'IE=edge');
return next();
};
return next()
}