[Modify] Polish it

This commit is contained in:
sta 2019-01-24 21:35:10 +09:00
parent b3cb11fc64
commit ac44ad80e9

View File

@ -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)