[Modify] Replace it
This commit is contained in:
parent
73c3c738b3
commit
16c85a524a
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user