[Modify] Add it
This commit is contained in:
parent
6d78c62023
commit
1d16b4364d
@ -782,6 +782,22 @@ namespace WebSocketSharp.Net
|
|||||||
base.Add (name, checkValue (value));
|
base.Add (name, checkValue (value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkAllowed (bool response)
|
||||||
|
{
|
||||||
|
if (_state == HttpHeaderType.Unspecified)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var headerType = response
|
||||||
|
? HttpHeaderType.Response
|
||||||
|
: HttpHeaderType.Request;
|
||||||
|
|
||||||
|
if (headerType != _state) {
|
||||||
|
var msg = "This instance does not allow the header.";
|
||||||
|
|
||||||
|
throw new InvalidOperationException (msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void checkAllowed (string name)
|
private void checkAllowed (string name)
|
||||||
{
|
{
|
||||||
if (_state == HttpHeaderType.Unspecified)
|
if (_state == HttpHeaderType.Unspecified)
|
||||||
|
Loading…
Reference in New Issue
Block a user