Skip to content

Commit

Permalink
Merge pull request #1083 from aka-demik/digestAuthFix
Browse files Browse the repository at this point in the history
strip() DigestAuth directives and make them case-insensitive.
  • Loading branch information
s-ludwig committed May 1, 2015
2 parents 83ba753 + 6e6c36c commit 879a2c8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions source/vibe/http/auth/digest_auth.d
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ private bool checkDigest(scope HTTPServerRequest req, DigestAuthInfo info, scope
string realm, nonce, response, uri, algorithm;
foreach (param; split((*pauth)[7 .. $], ",")) {
auto kv = split(param, "=");
if( kv[0] == "realm") realm = kv[1][1..$-1];
if( kv[0] == "username") username = kv[1][1..$-1];
if( kv[0] == "nonce") nonce = kv[1][1..$-1];
if( kv[0] == "uri") uri = kv[1][1..$-1];
if( kv[0] == "response") response = kv[1][1..$-1];
if( kv[0] == "algorithm") algorithm = kv[1][1..$-1];
auto key = kv[0].strip().toLower();
if( key == "realm") realm = kv[1][1..$-1];
if( key == "username") username = kv[1][1..$-1];
if( key == "nonce") nonce = kv[1][1..$-1];
if( key == "uri") uri = kv[1][1..$-1];
if( key == "response") response = kv[1][1..$-1];
if( key == "algorithm") algorithm = kv[1][1..$-1];
}

if (realm != info.realm)
Expand Down

0 comments on commit 879a2c8

Please sign in to comment.