Skip to content

Commit

Permalink
Merge pull request #1365 from mozilla/add-hsts-to-heroku-1295
Browse files Browse the repository at this point in the history
fix #1295 add hsts to heroku
  • Loading branch information
groovecoder authored Nov 14, 2019
2 parents e56b8d4 + 9dc5581 commit eb5e5f8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ try {
})();

// Use helmet to set security headers
// disable default HSTS; Ops handles it in stage & prod configs
app.use(helmet({
hsts: false,
}));
// only enable HSTS on heroku; Ops handles it in stage & prod configs
const hsts = AppConstants.NODE_ENV === "heroku" ? true : false;
app.use(helmet({ hsts }));

const SCRIPT_SOURCES = ["'self'", "https://www.google-analytics.com/analytics.js"];
const STYLE_SOURCES = ["'self'", "https://code.cdn.mozilla.net/fonts/"];
Expand Down

0 comments on commit eb5e5f8

Please sign in to comment.