[Modify] Move it
This commit is contained in:
parent
f775caf21b
commit
e1fa25f872
@ -75,6 +75,7 @@ namespace WebSocketSharp.Net
|
||||
private Guid _requestTraceIdentifier;
|
||||
private Uri _url;
|
||||
private Uri _urlReferrer;
|
||||
private bool _urlSet;
|
||||
private string _userHostName;
|
||||
private bool _userHostNameSet;
|
||||
private string[] _userLanguages;
|
||||
@ -412,8 +413,10 @@ namespace WebSocketSharp.Net
|
||||
public NameValueCollection QueryString {
|
||||
get {
|
||||
if (_queryString == null) {
|
||||
var url = Url;
|
||||
_queryString = HttpUtility.InternalParseQueryString (
|
||||
_url.Query, Encoding.UTF8
|
||||
url != null ? url.Query : null,
|
||||
Encoding.UTF8
|
||||
);
|
||||
}
|
||||
|
||||
@ -467,6 +470,17 @@ namespace WebSocketSharp.Net
|
||||
/// </value>
|
||||
public Uri Url {
|
||||
get {
|
||||
if (!_urlSet) {
|
||||
_url = HttpUtility.CreateRequestUrl (
|
||||
_rawUrl,
|
||||
_userHostName ?? UserHostAddress,
|
||||
IsWebSocketRequest,
|
||||
IsSecureConnection
|
||||
);
|
||||
|
||||
_urlSet = true;
|
||||
}
|
||||
|
||||
return _url;
|
||||
}
|
||||
}
|
||||
@ -664,18 +678,6 @@ namespace WebSocketSharp.Net
|
||||
return;
|
||||
}
|
||||
|
||||
_url = HttpUtility.CreateRequestUrl (
|
||||
_rawUrl,
|
||||
hasHost ? host : UserHostAddress,
|
||||
IsWebSocketRequest,
|
||||
IsSecureConnection
|
||||
);
|
||||
|
||||
if (_url == null) {
|
||||
_context.ErrorMessage = "Invalid request url";
|
||||
return;
|
||||
}
|
||||
|
||||
var transferEnc = _headers["Transfer-Encoding"];
|
||||
if (transferEnc != null) {
|
||||
if (_protocolVersion < HttpVersion.Version11) {
|
||||
|
@ -924,7 +924,13 @@ namespace WebSocketSharp.Server
|
||||
|
||||
private void processRequest (HttpListenerWebSocketContext context)
|
||||
{
|
||||
var path = context.RequestUri.AbsolutePath;
|
||||
var uri = context.RequestUri;
|
||||
if (uri == null) {
|
||||
context.Close (HttpStatusCode.BadRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
var path = uri.AbsolutePath;
|
||||
|
||||
WebSocketServiceHost host;
|
||||
if (!_services.InternalTryGetServiceHost (path, out host)) {
|
||||
|
Loading…
Reference in New Issue
Block a user