Removed checking if an empty string from the Ext.TryCreateWebSocketUri method

This commit is contained in:
sta 2014-12-21 15:28:48 +09:00
parent 7f01d41679
commit 47931c9a42
3 changed files with 6 additions and 4 deletions

View File

@ -852,10 +852,6 @@ namespace WebSocketSharp
this string uriString, out Uri result, out string message)
{
result = null;
if (uriString.Length == 0) {
message = "An empty string.";
return false;
}
var uri = uriString.ToUri ();
if (!uri.IsAbsoluteUri) {

View File

@ -144,6 +144,9 @@ namespace WebSocketSharp.Server
if (url == null)
throw new ArgumentNullException ("url");
if (url.Length == 0)
throw new ArgumentException ("An empty string.", "url");
string msg;
if (!tryCreateUri (url, out _uri, out msg))
throw new ArgumentException (msg, "url");

View File

@ -180,6 +180,9 @@ namespace WebSocketSharp
if (url == null)
throw new ArgumentNullException ("url");
if (url.Length == 0)
throw new ArgumentException ("An empty string.", "url");
string msg;
if (!url.TryCreateWebSocketUri (out _uri, out msg))
throw new ArgumentException (msg, "url");