Skip to content
This repository has been archived by the owner on Apr 26, 2019. It is now read-only.

Commit

Permalink
Fixed a trouble with incorrect reply
Browse files Browse the repository at this point in the history
The reply was calling a function when `continue` is a Symbol.
  • Loading branch information
TngSam authored Jan 20, 2019
1 parent 0d94d14 commit a63ed3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = addCorsHeaders

function addCorsHeaders (request, reply) {
if (!request.headers.origin) {
return reply.continue()
return reply.continue
}

// depending on whether we have a boom or not,
Expand All @@ -12,7 +12,7 @@ function addCorsHeaders (request, reply) {
response.headers['access-control-allow-origin'] = request.headers.origin
response.headers['access-control-allow-credentials'] = 'true'
if (request.method !== 'options') {
return reply.continue()
return reply.continue
}

response.statusCode = 200
Expand All @@ -26,5 +26,5 @@ function addCorsHeaders (request, reply) {
response.headers['access-control-allow-methods'] = request.headers['access-control-request-method']
}

reply.continue()
reply.continue
}

0 comments on commit a63ed3d

Please sign in to comment.