From fc5a7dea8d215fc7ca06e893644c1e6ef922cfac Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 29 May 2020 19:18:36 +0900 Subject: [PATCH] [Modify] Add it --- websocket-sharp/Net/WebHeaderCollection.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/websocket-sharp/Net/WebHeaderCollection.cs b/websocket-sharp/Net/WebHeaderCollection.cs index 76c55eb3..1e49911f 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -798,6 +798,21 @@ namespace WebSocketSharp.Net } } + private void checkAllowed (HttpHeaderType headerType) + { + if (_state == HttpHeaderType.Unspecified) + return; + + if (headerType == HttpHeaderType.Unspecified) + return; + + if (headerType != _state) { + var msg = "This instance does not allow the header."; + + throw new InvalidOperationException (msg); + } + } + private void checkAllowed (string name) { if (_state == HttpHeaderType.Unspecified)