[Modify] Polish it

This commit is contained in:
sta 2020-03-15 22:23:46 +09:00
parent 1d14400c0e
commit bb79090408

View File

@ -826,13 +826,20 @@ namespace WebSocketSharp.Net
if (_state == HttpHeaderType.Unspecified) if (_state == HttpHeaderType.Unspecified)
return; return;
if (response && _state == HttpHeaderType.Request) if (response) {
throw new InvalidOperationException ( if (_state == HttpHeaderType.Response)
"This collection has already been used to store the request headers."); return;
if (!response && _state == HttpHeaderType.Response) var msg = "This collection has already been used for the request headers.";
throw new InvalidOperationException (
"This collection has already been used to store the response headers."); throw new InvalidOperationException (msg);
}
if (_state == HttpHeaderType.Response) {
var msg = "This collection has already been used for the response headers.";
throw new InvalidOperationException (msg);
}
} }
private static string checkValue (string value) private static string checkValue (string value)