diff options
author | happycoloredbanana <happycoloredbanana@users.noreply.github.com> | 2017-05-21 22:13:11 +0300 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-21 21:13:11 +0200 |
commit | 7fba4cb3d1a4a4d0ba6713b4e01584faef9c369a (patch) | |
tree | d98e63563de80e725cf714236c176b3f0bd9deac /streaming | |
parent | a4c757767fca00478f49a77b2274cbe179f82e21 (diff) |
Allow access token in URI (#3208)
Diffstat (limited to 'streaming')
-rw-r--r-- | streaming/index.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/streaming/index.js b/streaming/index.js index b020d59fc..627b677a8 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -199,8 +199,9 @@ if (cluster.isMaster) { } const authorization = req.get('Authorization'); + const accessToken = req.query.access_token; - if (!authorization) { + if (!authorization && !accessToken) { const err = new Error('Missing access token'); err.statusCode = 401; @@ -208,7 +209,7 @@ if (cluster.isMaster) { return; } - const token = authorization.replace(/^Bearer /, ''); + const token = authorization ? authorization.replace(/^Bearer /, '') : accessToken; accountFromToken(token, req, next); }; |