|
|
|
|
@ -782,6 +782,23 @@ namespace WebSocketSharp.Net
|
|
|
|
|
base.Add (name, checkValue (value));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkAllowed (string name)
|
|
|
|
|
{
|
|
|
|
|
if (_state == HttpHeaderType.Unspecified)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var headerType = getHeaderType (name);
|
|
|
|
|
|
|
|
|
|
if (headerType == HttpHeaderType.Unspecified)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (_state != headerType) {
|
|
|
|
|
var msg = "This collection does not allow the header.";
|
|
|
|
|
|
|
|
|
|
throw new InvalidOperationException (msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static string checkName (string name)
|
|
|
|
|
{
|
|
|
|
|
if (name == null)
|
|
|
|
|
|