Skip to content

Instantly share code, notes, and snippets.

@bjornlll
Forked from strikeout/header.js
Last active May 16, 2017 03:43
Show Gist options
  • Save bjornlll/0e3b397808acb659b2b5588d9bd629cc to your computer and use it in GitHub Desktop.
Save bjornlll/0e3b397808acb659b2b5588d9bd629cc to your computer and use it in GitHub Desktop.
Attach Meteor HTTP "Referrer-Policy" Headers
Meteor.startup(() => {
WebApp.connectHandlers.use((req, res, next) => {
// See https://blog.appcanary.com/2017/http-security-headers.html#referrer-policy for details,
// and information around the other possible values for the Referrer-Policy header:
// - "no-referrer"
// - "no-referrer-when-downgrade"
// - "origin"
// - "origin-when-cross-origi"
// - "same-origin"
// - "strict-origin"
// - "strict-origin-when-cross-origin"
// - "unsafe-url"
res.setHeader("Referrer-Policy", "no-referrer");
return next();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment