[Modify] Replace it
This commit is contained in:
@@ -517,9 +517,21 @@ namespace WebSocketSharp.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
set {
|
set {
|
||||||
string msg;
|
if (value == null)
|
||||||
if (!canSetName (value, out msg))
|
throw new ArgumentNullException ("value");
|
||||||
throw new CookieException (msg);
|
|
||||||
|
if (value.Length == 0)
|
||||||
|
throw new ArgumentException ("An empty string.", "value");
|
||||||
|
|
||||||
|
if (value[0] == '$') {
|
||||||
|
var msg = "It starts with a dollar sign.";
|
||||||
|
throw new ArgumentException (msg, "value");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.Contains (_reservedCharsForName)) {
|
||||||
|
var msg = "It contains an invalid character.";
|
||||||
|
throw new ArgumentException (msg, "value");
|
||||||
|
}
|
||||||
|
|
||||||
_name = value;
|
_name = value;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user