Standard JS code conversion + fixes
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user