[Modify] Polish it

This commit is contained in:
sta 2020-04-29 19:49:53 +09:00
parent 0c746bfcfa
commit 84082ee25a

View File

@ -1112,11 +1112,17 @@ namespace WebSocketSharp.Net
/// </exception>
public void Add (string header)
{
if (header == null || header.Length == 0)
if (header == null)
throw new ArgumentNullException ("header");
if (header.Length == 0)
throw new ArgumentException ("An empty string.", "header");
var pos = checkColonSeparated (header);
add (header.Substring (0, pos), header.Substring (pos + 1), false);
var name = header.Substring (0, pos);
var val = header.Substring (pos + 1);
add (name, val, false);
}
/// <summary>