[Modify] Replace it
This commit is contained in:
parent
d291763b05
commit
9a584f4b80
@ -1599,22 +1599,7 @@ namespace WebSocketSharp.Net
|
|||||||
/// </exception>
|
/// </exception>
|
||||||
public static bool IsRestricted (string headerName, bool response)
|
public static bool IsRestricted (string headerName, bool response)
|
||||||
{
|
{
|
||||||
if (headerName == null)
|
headerName = checkName (headerName, "headerName");
|
||||||
throw new ArgumentNullException ("headerName");
|
|
||||||
|
|
||||||
if (headerName.Length == 0)
|
|
||||||
throw new ArgumentException ("An empty string.", "headerName");
|
|
||||||
|
|
||||||
headerName = headerName.Trim ();
|
|
||||||
|
|
||||||
if (headerName.Length == 0)
|
|
||||||
throw new ArgumentException ("A string of spaces.", "headerName");
|
|
||||||
|
|
||||||
if (!headerName.IsToken ()) {
|
|
||||||
var msg = "It contains an invalid character.";
|
|
||||||
|
|
||||||
throw new ArgumentException (msg, "headerName");
|
|
||||||
}
|
|
||||||
|
|
||||||
return isRestricted (headerName, response);
|
return isRestricted (headerName, response);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user