Skip to content

Commit

Permalink
Merge pull request restify#103 from ab500/master
Browse files Browse the repository at this point in the history
Two small changes to enable new features
  • Loading branch information
mcavage committed Mar 12, 2012
2 parents 8b3801a + 791fbbe commit d6c1c85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/plugins/authorization.js
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/multipart_parser.js
Expand Up @@ -41,6 +41,7 @@ function multipartBodyParser(options) {
return next(new BadRequestError(err.toString()));

req.body = fields;
req.files = files;

if (options.mapParams !== false) {
Object.keys(fields).forEach(function (k) {
Expand Down

0 comments on commit d6c1c85

Please sign in to comment.