Skip to content

Commit

Permalink
Merge pull request #34 from OmgImAlexis/master
Browse files Browse the repository at this point in the history
fix koa DEBUG name not being set
  • Loading branch information
venables committed Oct 20, 2017
2 parents b851339 + 525aa4d commit 427a615
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/koa-helmet.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ const promisify = require('./promisify')
const koaHelmet = function () {
const helmetPromise = promisify(helmet.apply(null, arguments))

return (ctx, next) => {
const middleware = (ctx, next) => {
ctx.req.secure = ctx.request.secure
return helmetPromise(ctx.req, ctx.res).then(next)
}
middleware._name = 'helmet'
return middleware
}

Object.keys(helmet).forEach(function (helmetMethod) {
Expand Down

0 comments on commit 427a615

Please sign in to comment.