diff --git a/websocket-sharp/Net/HttpListenerResponse.cs b/websocket-sharp/Net/HttpListenerResponse.cs index 610199b4..394c3afe 100644 --- a/websocket-sharp/Net/HttpListenerResponse.cs +++ b/websocket-sharp/Net/HttpListenerResponse.cs @@ -826,6 +826,22 @@ namespace WebSocketSharp.Net } } + private static bool isValidForContentType (string value) + { + foreach (var c in value) { + if (c < 0x20) + return false; + + if (c > 0x7e) + return false; + + if ("()<>@:\\[]?{}".IndexOf (c) > -1) + return false; + } + + return true; + } + #endregion #region Public Methods