Skip to content

Commit

Permalink
fix: fixed HSTS issue per <chromium/hstspreload.org#198>
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed Oct 16, 2020
1 parent 94e6c70 commit 8b1c97d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ class Web {
// remove trailing slashes
app.use(removeTrailingSlashes());

// security
// (needs to come before i18n so HSTS header gets added)
if (this.config.helmet) app.use(helmet(this.config.helmet));

// i18n
if (this.config.i18n) {
// create new @ladjs/i18n instance
Expand All @@ -262,9 +266,6 @@ class Web {
// cors
if (this.config.cors) app.use(cors(this.config.cors));

// security
if (this.config.helmet) app.use(helmet(this.config.helmet));

// compress/gzip
if (this.config.compress) app.use(compress(this.config.compress));

Expand Down

0 comments on commit 8b1c97d

Please sign in to comment.