Skip to content

Commit 25e019f

Browse files
committed
Add additional suggested security headers
1 parent bdc386c commit 25e019f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/defaultHeadersMiddleware.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ module.exports = (req, res, next) => {
1010
res.set({
1111
// this should come after express.static otherwise it overrides
1212
'Cache-Control': 'max-age=300',
13+
14+
// https://observatory.mozilla.org/ for recommended settings
1315
'Strict-Transport-Security': 'max-age=15768000; includeSubDomains; preload',
16+
'Referrer-Policy': 'no-referrer',
17+
'X-Content-Type-Options': 'nosniff',
18+
'X-XSS-Protection': '1; mode=block',
19+
'X-Frame-Options': 'SAMEORIGIN'
1420
});
1521
next();
1622
};

0 commit comments

Comments
 (0)