[Modify] Polish it

This commit is contained in:
sta 2017-04-22 18:24:23 +09:00
parent ac311e7759
commit a3115d1161

View File

@ -168,15 +168,18 @@ namespace WebSocketSharp.Net
#region Internal Methods #region Internal Methods
internal bool IsValid (string password, string realm, string method, string entity) internal bool IsValid (
string password, string realm, string method, string entity
)
{ {
var parameters = new NameValueCollection (_parameters); var copied = new NameValueCollection (_parameters);
parameters["password"] = password; copied["password"] = password;
parameters["realm"] = realm; copied["realm"] = realm;
parameters["method"] = method; copied["method"] = method;
parameters["entity"] = entity; copied["entity"] = entity;
return _parameters["response"] == AuthenticationResponse.CreateRequestDigest (parameters); var expected = AuthenticationResponse.CreateRequestDigest (copied);
return _parameters["response"] == expected;
} }
#endregion #endregion