[Modify] Add it

This commit is contained in:
sta 2020-05-29 19:24:24 +09:00
parent fc5a7dea8d
commit e29cfd970a

View File

@ -879,6 +879,20 @@ namespace WebSocketSharp.Net
} }
} }
private void checkRestricted (string name, HttpHeaderType headerType)
{
if (_internallyUsed)
return;
var res = headerType == HttpHeaderType.Response;
if (isRestricted (name, res)) {
var msg = "The header is a restricted header.";
throw new ArgumentException (msg);
}
}
private void checkState (bool response) private void checkState (bool response)
{ {
if (_state == HttpHeaderType.Unspecified) if (_state == HttpHeaderType.Unspecified)