diff options
author | Alan Pearce | 2017-06-24 23:39:18 +0200 |
---|---|---|
committer | Alan Pearce | 2017-06-24 23:39:18 +0200 |
commit | 6061d1e5b5bdd67ab958c7cedc2f3fe5712e3ea2 (patch) | |
tree | 9d67f7da80027799018a6c0042bef203df31665e /src | |
parent | abd28f9633da4ac2f7fbdfd930c11a46b567b105 (diff) | |
download | homestead-6061d1e5b5bdd67ab958c7cedc2f3fe5712e3ea2.tar.lz homestead-6061d1e5b5bdd67ab958c7cedc2f3fe5712e3ea2.tar.zst homestead-6061d1e5b5bdd67ab958c7cedc2f3fe5712e3ea2.zip |
feat: add some security with helmet
Diffstat (limited to 'src')
-rw-r--r-- | src/app.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/app.js b/src/app.js index 46ebd2e..fa0d5c2 100644 --- a/src/app.js +++ b/src/app.js @@ -3,6 +3,8 @@ const Koa = require('koa') const app = new Koa() +const helmet = require('koa-helmet') + const actions = require('./actions.js') const config = require('./modules/config.js') @@ -26,6 +28,14 @@ for (let [term, items] of Posts.taxonomies) { ) } +app.use( + helmet({ + hsts: { + setIf: ctx => ctx.secure + } + }) +) + app.use(router.routes()).use(router.allowedMethods()) app.use(actions.serveFiles) |