mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 00:03:28 +02:00
Use capital letter in Bearer as per rfc spec
This commit is contained in:
@@ -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'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user