Skip to content

Commit

Permalink
Make basicauth work with lower-case password hashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hns committed May 27, 2011
1 parent a9cf4fd commit 6226bcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/stick/middleware/basicauth.js
Expand Up @@ -9,7 +9,7 @@
* @example
* app.configure("basicauth");
* app.basicauth('/protected/path', 'admin',
* '30b93f320076de1304c34673f9f524f7ea7db709');
* '30B93F320076DE1304C34673F9F524F7EA7DB709');
*
*/

Expand All @@ -28,7 +28,8 @@ exports.middleware = function basicauth(next, app) {

app.basicauth = function(path, role, sha1) {
config[path] = {};
config[path][role] = sha1;
// strings.digest() uses upper-case hex encoding
config[path][role] = String(sha1).toUpperCase();
};

return function basicauth(req) {
Expand Down

0 comments on commit 6226bcf

Please sign in to comment.