Permalink
Browse files

Dirty hack to get initial parameter from authorization header

  • Loading branch information...
nijikokun committed Apr 11, 2013
1 parent 47b81f1 commit 313eba934d1ddb01c75a9adbe43f1af002cb7b7f
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/utils.js
View
@@ -89,8 +89,14 @@ utils.parseHeader = function (header) {
if (match[2] === "=")
params[match[1]] = utils.decodeData(match[3] || "");
- else
+ else {
params['bearer'] = utils.decodeData(match[1]);
+
+ if (match.input.indexOf(" ")) {
+ match = match.input.split(" ")[1].match(/(\w+)(?:([:=]) ?"?([\w\+\%\=\;]+)?"?)?/);
+ if (match[2] === "=") params[match[1]] = utils.decodeData(match[3] || "");
+ }
+ }
});
return params;

0 comments on commit 313eba9

Please sign in to comment.