[Modify] Polish it
This commit is contained in:
parent
0c746bfcfa
commit
84082ee25a
@ -1112,11 +1112,17 @@ namespace WebSocketSharp.Net
|
|||||||
/// </exception>
|
/// </exception>
|
||||||
public void Add (string header)
|
public void Add (string header)
|
||||||
{
|
{
|
||||||
if (header == null || header.Length == 0)
|
if (header == null)
|
||||||
throw new ArgumentNullException ("header");
|
throw new ArgumentNullException ("header");
|
||||||
|
|
||||||
|
if (header.Length == 0)
|
||||||
|
throw new ArgumentException ("An empty string.", "header");
|
||||||
|
|
||||||
var pos = checkColonSeparated (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>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user