summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/app.js b/app.js
index 1508781c..62e6627d 100644
--- a/app.js
+++ b/app.js
@@ -97,11 +97,16 @@ var sessionStore = new SequelizeStore({
app.use(compression())
// use hsts to tell https users stick to this
-app.use(helmet.hsts({
- maxAge: 31536000 * 1000, // 365 days
- includeSubdomains: true,
- preload: true
-}))
+if (config.hsts.enable) {
+ app.use(helmet.hsts({
+ maxAge: config.hsts.maxAgeSeconds * 1000,
+ includeSubdomains: config.hsts.includeSubdomains,
+ preload: config.hsts.preload
+ }))
+} else if (config.usessl) {
+ logger.info('Consider enabling HSTS for extra security:')
+ logger.info('https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security')
+}
i18n.configure({
locales: ['en', 'zh', 'fr', 'de', 'ja', 'es', 'ca', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk', 'hi', 'sv', 'eo', 'da'],