From f7283c0043e1e75204dc41a06f035bdd5af1de4d Mon Sep 17 00:00:00 2001 From: sta Date: Thu, 21 May 2020 19:40:46 +0900 Subject: [PATCH] [Modify] Add a check if response or not --- websocket-sharp/Net/WebHeaderCollection.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/websocket-sharp/Net/WebHeaderCollection.cs b/websocket-sharp/Net/WebHeaderCollection.cs index 716cd89e..71a5b7b8 100644 --- a/websocket-sharp/Net/WebHeaderCollection.cs +++ b/websocket-sharp/Net/WebHeaderCollection.cs @@ -842,7 +842,10 @@ namespace WebSocketSharp.Net if (_internallyUsed) return; - if (isRestricted (name, true)) { + var headerType = getHeaderType (name); + var res = headerType == HttpHeaderType.Response; + + if (isRestricted (name, res)) { var msg = "This header must be modified with the appropiate property."; throw new ArgumentException (msg);