[Modify] Polish it
This commit is contained in:
parent
b2c5f954ba
commit
e018206536
@ -557,16 +557,24 @@ namespace WebSocketSharp.Net
|
|||||||
Func<IIdentity, NetworkCredential> credentialsFinder
|
Func<IIdentity, NetworkCredential> credentialsFinder
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (response == null)
|
if (response == null || response.Length == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (credentialsFinder == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!(scheme == AuthenticationSchemes.Basic || scheme == AuthenticationSchemes.Digest))
|
if (!(scheme == AuthenticationSchemes.Basic || scheme == AuthenticationSchemes.Digest))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!response.StartsWith (scheme.ToString (), StringComparison.OrdinalIgnoreCase))
|
if (scheme == AuthenticationSchemes.Digest) {
|
||||||
return null;
|
if (realm == null || realm.Length == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
if (credentialsFinder == null)
|
if (method == null || method.Length == 0)
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!response.StartsWith (scheme.ToString (), StringComparison.OrdinalIgnoreCase))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var res = AuthenticationResponse.Parse (response);
|
var res = AuthenticationResponse.Parse (response);
|
||||||
|
Loading…
Reference in New Issue
Block a user