Refactored a few for HttpServer.cs

master
sta 11 years ago
parent 624b20afa8
commit 8cd2248b2b

@ -741,7 +741,12 @@ namespace WebSocketSharp.Server
result = null; result = null;
var uri = uriString.ToUri (); var uri = uriString.ToUri ();
if (uri == null || !uri.IsAbsoluteUri) { if (uri == null) {
message = "An invalid URI string: " + uriString;
return false;
}
if (!uri.IsAbsoluteUri) {
message = "Not an absolute URI: " + uriString; message = "Not an absolute URI: " + uriString;
return false; return false;
} }
@ -762,8 +767,8 @@ namespace WebSocketSharp.Server
return false; return false;
} }
if (uri.Port < 1) { if (uri.Port == 0) {
message = "The port part is less than 1: " + uriString; message = "The port part is zero: " + uriString;
return false; return false;
} }

Loading…
Cancel
Save