From ae9bc482585059a0a05f3735cc7e14fdc8cc4b21 Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 21 Jan 2019 21:16:44 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpUtility.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/websocket-sharp/Net/HttpUtility.cs b/websocket-sharp/Net/HttpUtility.cs index 276bffc5..cea42b89 100644 --- a/websocket-sharp/Net/HttpUtility.cs +++ b/websocket-sharp/Net/HttpUtility.cs @@ -764,12 +764,6 @@ namespace WebSocketSharp.Net if (response == null || response.Length == 0) return null; - if (credentialsFinder == null) - return null; - - if (!(scheme == AuthenticationSchemes.Basic || scheme == AuthenticationSchemes.Digest)) - return null; - if (scheme == AuthenticationSchemes.Digest) { if (realm == null || realm.Length == 0) return null; @@ -777,6 +771,13 @@ namespace WebSocketSharp.Net if (method == null || method.Length == 0) return null; } + else { + if (scheme != AuthenticationSchemes.Basic) + return null; + } + + if (credentialsFinder == null) + return null; if (!response.StartsWith (scheme.ToString (), StringComparison.OrdinalIgnoreCase)) return null;