Fix for request url in HttpListenerRequest.cs
This commit is contained in:
parent
a9b00d6d9d
commit
9909c52d2d
@ -568,6 +568,7 @@ namespace WebSocketSharp.Net
|
|||||||
if (noHost)
|
if (noHost)
|
||||||
host = UserHostAddress;
|
host = UserHostAddress;
|
||||||
|
|
||||||
|
string scheme = null;
|
||||||
string path = null;
|
string path = null;
|
||||||
if (_uri.StartsWith ("/")) {
|
if (_uri.StartsWith ("/")) {
|
||||||
path = HttpUtility.UrlDecode (_uri);
|
path = HttpUtility.UrlDecode (_uri);
|
||||||
@ -580,6 +581,7 @@ namespace WebSocketSharp.Net
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scheme = uri.Scheme;
|
||||||
host = uri.Authority;
|
host = uri.Authority;
|
||||||
path = uri.PathAndQuery;
|
path = uri.PathAndQuery;
|
||||||
}
|
}
|
||||||
@ -590,14 +592,12 @@ namespace WebSocketSharp.Net
|
|||||||
host = HttpUtility.UrlDecode (_uri);
|
host = HttpUtility.UrlDecode (_uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
var scheme = IsWebSocketRequest ? "ws" : "http";
|
if (scheme == null)
|
||||||
var secure = IsSecureConnection;
|
scheme = (IsWebSocketRequest ? "ws" : "http") + (IsSecureConnection ? "s" : String.Empty);
|
||||||
if (secure)
|
|
||||||
scheme += "s";
|
|
||||||
|
|
||||||
var colon = host.IndexOf (':');
|
var colon = host.IndexOf (':');
|
||||||
if (colon == -1)
|
if (colon == -1)
|
||||||
host = String.Format ("{0}:{1}", host, secure ? 443 : 80);
|
host = String.Format ("{0}:{1}", host, scheme == "http" || scheme == "ws" ? 80 : 443);
|
||||||
|
|
||||||
var url = String.Format ("{0}://{1}{2}", scheme, host, path);
|
var url = String.Format ("{0}://{1}{2}", scheme, host, path);
|
||||||
if (!Uri.TryCreate (url, UriKind.Absolute, out _url)) {
|
if (!Uri.TryCreate (url, UriKind.Absolute, out _url)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user