[Modify] Polish it
This commit is contained in:
parent
b3cb11fc64
commit
ac44ad80e9
@ -803,16 +803,15 @@ namespace WebSocketSharp.Net
|
|||||||
|
|
||||||
if (scheme == AuthenticationSchemes.Basic) {
|
if (scheme == AuthenticationSchemes.Basic) {
|
||||||
var basicId = (HttpBasicIdentity) id;
|
var basicId = (HttpBasicIdentity) id;
|
||||||
if (basicId.Password != cred.Password)
|
return basicId.Password == cred.Password
|
||||||
return null;
|
? new GenericPrincipal (id, cred.Roles)
|
||||||
}
|
: null;
|
||||||
else {
|
|
||||||
var digestId = (HttpDigestIdentity) id;
|
|
||||||
if (!digestId.IsValid (cred.Password, realm, method, null))
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new GenericPrincipal (id, cred.Roles);
|
var digestId = (HttpDigestIdentity) id;
|
||||||
|
return digestId.IsValid (cred.Password, realm, method, null)
|
||||||
|
? new GenericPrincipal (id, cred.Roles)
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static Encoding GetEncoding (string contentType)
|
internal static Encoding GetEncoding (string contentType)
|
||||||
|
Loading…
Reference in New Issue
Block a user