Permalink
Browse files

Small fix to allow for username-only HTTP basic auth

  • Loading branch information...
1 parent 90acf48 commit 791fbbe7abb6309ae9e7af4dbf2f2848cff256ae @anroOfCode committed Mar 12, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/plugins/authorization.js
@@ -39,9 +39,13 @@ function parseBasic(string) {
pieces = [decoded.slice(0, index), decoded.slice(index + 1)];
}
- if (!pieces || !pieces[0] || !pieces[1])
+ if (!pieces || !pieces[0])
throw new InvalidHeaderError('Authorization header invalid');
+ // Allows for passwordless authentication
+ if (!pieces[1])
+ pieces[1] = null;
+
return {
username: pieces[0],
password: pieces[1]

0 comments on commit 791fbbe

Please sign in to comment.