Skip to content

Commit

Permalink
make token regex case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
esbenp committed Aug 13, 2017
1 parent 47e947e commit aeff470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function createApi(queue, options = {}) {
api.post('/', function(req, res) {
var authHeader = req.get('Authorization')

if (token && (!authHeader || authHeader.replace(/Bearer (.*)$/, '$1') !== token)) {
if (token && (!authHeader || authHeader.replace(/Bearer (.*)$/i, '$1') !== token)) {
res.status(401).json(error.createErrorResponse(error.ERROR_INVALID_TOKEN))
return
}
Expand Down

0 comments on commit aeff470

Please sign in to comment.