From c3b32ec1a461a1bb060367e15347d7640ceddd69 Mon Sep 17 00:00:00 2001 From: sta Date: Mon, 29 Apr 2019 15:58:05 +0900 Subject: [PATCH] [Modify] It must be a token --- websocket-sharp/Net/Cookie.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/websocket-sharp/Net/Cookie.cs b/websocket-sharp/Net/Cookie.cs index cf6b5f86..a7a97681 100644 --- a/websocket-sharp/Net/Cookie.cs +++ b/websocket-sharp/Net/Cookie.cs @@ -90,7 +90,6 @@ namespace WebSocketSharp.Net private string _path; private string _port; private int[] _ports; - private static readonly char[] _reservedCharsForName; private static readonly char[] _reservedCharsForValue; private bool _secure; private DateTime _timeStamp; @@ -104,7 +103,6 @@ namespace WebSocketSharp.Net static Cookie () { _emptyPorts = new int[0]; - _reservedCharsForName = new[] { ' ', '=', ';', ',', '\n', '\r', '\t' }; _reservedCharsForValue = new[] { ';', ',' }; } @@ -297,7 +295,7 @@ namespace WebSocketSharp.Net throw new ArgumentException (msg, "name"); } - if (name.Contains (_reservedCharsForName)) { + if (!name.IsToken ()) { var msg = "It contains an invalid character."; throw new ArgumentException (msg, "name"); } @@ -560,7 +558,7 @@ namespace WebSocketSharp.Net throw new ArgumentException (msg, "value"); } - if (value.Contains (_reservedCharsForName)) { + if (!value.IsToken ()) { var msg = "It contains an invalid character."; throw new ArgumentException (msg, "value"); }