[Modify] Replace it

This commit is contained in:
sta 2019-03-11 21:38:17 +09:00
parent 1230d354a0
commit 4223d1ced9

View File

@ -683,9 +683,15 @@ namespace WebSocketSharp.Net
} }
set { set {
string msg; if (value == null)
if (!canSetValue (value, out msg)) throw new ArgumentNullException ("value");
throw new CookieException (msg);
if (value.Contains (_reservedCharsForValue)) {
if (!value.IsEnclosedIn ('"')) {
var msg = "A string not enclosed in double quotes.";
throw new ArgumentException (msg, "value");
}
}
_value = value.Length > 0 ? value : "\"\""; _value = value.Length > 0 ? value : "\"\"";
} }