[Modify] Replace it
This commit is contained in:
parent
f56521f6a7
commit
bd249ac6e3
@ -1412,7 +1412,22 @@ namespace WebSocketSharp.Net
|
||||
/// </exception>
|
||||
public static bool IsRestricted (string headerName, bool response)
|
||||
{
|
||||
headerName = checkName (headerName);
|
||||
if (headerName == null)
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user