diff --git a/websocket-sharp/Net/WebHeaderCollection.cs b/websocket-sharp/Net/WebHeaderCollection.cs index a9993a5f..66bd7045 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -797,6 +797,9 @@ namespace WebSocketSharp.Net name = name.Trim (); + if (name.Length == 0) + throw new ArgumentException ("A string of spaces.", "name"); + if (!IsHeaderName (name)) { var msg = "It contains an invalid character.";