Skip to content

Commit

Permalink
Refactor for clarity based on CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmchase committed Nov 30, 2018
1 parent f1fbe9c commit 23b752a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cors.js
Expand Up @@ -86,9 +86,9 @@ module.exports = function cors(config) {
return res.status(403).send(template);
}

const requestHeaders = (req.get("access-control-request-headers") || "")
.split(",")
.filter(h => h);
const requestHeaders = req.get("access-control-request-headers")
? req.get("access-control-request-headers").split(",")
: [];

const allowedHeaders = matchedRule
? requestHeaders
Expand Down

0 comments on commit 23b752a

Please sign in to comment.