Merge pull request #725 from SISheogorath/fix/referrerPolicy

Add referrer policy
This commit is contained in:
Christoph (Sheogorath) Kern 2018-02-12 22:23:19 +01:00 committed by GitHub
commit e793738833
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

7
app.js
View file

@ -110,6 +110,13 @@ if (config.hsts.enable) {
logger.info('https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security') logger.info('https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security')
} }
// Add referrer policy to improve privacy
app.use(
helmet.referrerPolicy({
policy: 'same-origin'
})
)
// Generate a random nonce per request, for CSP with inline scripts // Generate a random nonce per request, for CSP with inline scripts
app.use(csp.addNonceToLocals) app.use(csp.addNonceToLocals)