[Modify] Polish it
This commit is contained in:
parent
ac5559b15d
commit
bfbc42097e
@ -801,16 +801,16 @@ namespace WebSocketSharp.Net
|
|||||||
if (cred == null)
|
if (cred == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (scheme == AuthenticationSchemes.Basic
|
if (scheme == AuthenticationSchemes.Basic) {
|
||||||
&& ((HttpBasicIdentity) id).Password != cred.Password
|
var basicId = (HttpBasicIdentity) id;
|
||||||
) {
|
if (basicId.Password != cred.Password)
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scheme == AuthenticationSchemes.Digest
|
if (scheme == AuthenticationSchemes.Digest) {
|
||||||
&& !((HttpDigestIdentity) id).IsValid (cred.Password, realm, method, null)
|
var digestId = (HttpDigestIdentity) id;
|
||||||
) {
|
if (!digestId.IsValid (cred.Password, realm, method, null))
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new GenericPrincipal (id, cred.Roles);
|
return new GenericPrincipal (id, cred.Roles);
|
||||||
|
Loading…
Reference in New Issue
Block a user