mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Use capital letter in Bearer as per rfc spec
This commit is contained in:
parent
b1f7f67eb7
commit
484e56be12
2 changed files with 15 additions and 13 deletions
|
@ -9,16 +9,18 @@ module.exports = {
|
|||
accessTokenAuth: accessTokenAuth
|
||||
}
|
||||
|
||||
// Specifications: https://tools.ietf.org/html/rfc6750#section-2.1
|
||||
|
||||
function accessTokenAuth(req, res, next) {
|
||||
if (req.headers.authorization) {
|
||||
var authHeader = req.headers.authorization.split(' ')
|
||||
, format = authHeader[0]
|
||||
, tokenId = authHeader[1]
|
||||
|
||||
if (format !== 'bearer') {
|
||||
if (format !== 'Bearer') {
|
||||
return res.status(401).json({
|
||||
success: false
|
||||
, description: 'Authorization header should be in "bearer $AUTH_TOKEN" format'
|
||||
, description: 'Authorization header should be in "Bearer $AUTH_TOKEN" format'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue