diff --git a/websocket-sharp/Net/WebHeaderCollection.cs b/websocket-sharp/Net/WebHeaderCollection.cs index 86f7289e..b24fcc3e 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -1815,7 +1815,23 @@ namespace WebSocketSharp.Net /// public override void Set (string name, string value) { - doWithCheckingState (setWithoutCheckingName, checkName (name), value, true); + name = checkName (name); + value = checkValue (value); + + checkRestricted (name); + checkAllowed (name); + + base.Set (name, value); + + if (_state != HttpHeaderType.Unspecified) + return; + + var headerType = getHeaderType (name); + + if (headerType == HttpHeaderType.Unspecified) + return; + + _state = headerType; } ///