Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Commit

Permalink
Improves the security headers
Browse files Browse the repository at this point in the history
Attempts to fix all the security issues reported by the Mozilla
Observatory: https://observatory.mozilla.org/analyze/viz.scrapd.org

Fixes #194
  • Loading branch information
rgreinho committed Jan 27, 2020
1 parent 9fb8263 commit ececd17
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions csp.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<<<<<<< HEAD
const helmet = require('helmet');
const uuidv4 = require('uuid/v4');

// Configuration values mostly come from this talk:
// https://pyvideo.org/pybay-2019/browser-security-with-http-headers.html
// export default function csp(app) {
module.exports = function csp(app) {
=======
import helmet from 'helmet';
import uuidv4 from 'uuid/v4';

// Configuration values mostly come from this talk:
// https://pyvideo.org/pybay-2019/browser-security-with-http-headers.html
export default function csp(app) {
>>>>>>> Improves the security headers
// Create a nonce on every request and make it available to other middleware
app.use((req, res, next) => {
res.locals.nonce = Buffer.from(uuidv4()).toString('base64');
Expand Down

0 comments on commit ececd17

Please sign in to comment.