Skip to content

Commit

Permalink
fix: set clearer defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
willfarrell committed May 15, 2018
1 parent c080f47 commit 14bcede
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ const response = (opts, handler, next) => {
const options = Object.assign({}, defaults, opts)
const response = options.response

handler.response = handler.response || {}
handler.response = handler.response || {
body: {},
headers: {}
}

handler.response.headers = Object.assign(
{},
{
Expand All @@ -279,7 +283,7 @@ const response = (opts, handler, next) => {
handler.response.body.meta = Object.assign(
{},
response.meta,
handler.response.body.meta || {}
handler.response.body.meta
)
}

Expand Down

0 comments on commit 14bcede

Please sign in to comment.