[Modify] Add a check if response or not

This commit is contained in:
sta 2020-05-21 19:40:46 +09:00
parent 68036554db
commit f7283c0043

View File

@ -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);