Fix for internal uri of WebSocket class as a server
This commit is contained in:
parent
08bdca8fe8
commit
7147cde22c
@ -485,6 +485,9 @@ namespace WebSocketSharp.Server
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_uri.IsAbsoluteUri)
|
||||||
|
context.WebSocket.Url = new Uri (_uri, path);
|
||||||
|
|
||||||
host.StartSession (context);
|
host.StartSession (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ namespace WebSocketSharp
|
|||||||
_closeContext = context.Close;
|
_closeContext = context.Close;
|
||||||
_secure = context.IsSecureConnection;
|
_secure = context.IsSecureConnection;
|
||||||
_stream = context.Stream;
|
_stream = context.Stream;
|
||||||
_uri = context.RequestUri;
|
_uri = context.Path.ToUri ();
|
||||||
|
|
||||||
init ();
|
init ();
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ namespace WebSocketSharp
|
|||||||
_closeContext = context.Close;
|
_closeContext = context.Close;
|
||||||
_secure = context.IsSecureConnection;
|
_secure = context.IsSecureConnection;
|
||||||
_stream = context.Stream;
|
_stream = context.Stream;
|
||||||
_uri = context.RequestUri;
|
_uri = context.Path.ToUri ();
|
||||||
|
|
||||||
init ();
|
init ();
|
||||||
}
|
}
|
||||||
@ -1317,7 +1317,8 @@ namespace WebSocketSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// As server
|
// As server
|
||||||
private bool validateCookies (CookieCollection request, CookieCollection response)
|
private bool validateCookies (
|
||||||
|
CookieCollection request, CookieCollection response)
|
||||||
{
|
{
|
||||||
return _cookiesValidation != null
|
return _cookiesValidation != null
|
||||||
? _cookiesValidation (request, response)
|
? _cookiesValidation (request, response)
|
||||||
@ -1335,11 +1336,11 @@ namespace WebSocketSharp
|
|||||||
|
|
||||||
var i = value.IndexOf (':');
|
var i = value.IndexOf (':');
|
||||||
var host = i > 0 ? value.Substring (0, i) : value;
|
var host = i > 0 ? value.Substring (0, i) : value;
|
||||||
var type = Uri.CheckHostName (host);
|
var expected = _uri.DnsSafeHost;
|
||||||
|
|
||||||
return type != UriHostNameType.Dns ||
|
return Uri.CheckHostName (host) != UriHostNameType.Dns ||
|
||||||
Uri.CheckHostName (_uri.DnsSafeHost) != UriHostNameType.Dns ||
|
Uri.CheckHostName (expected) != UriHostNameType.Dns ||
|
||||||
host == _uri.DnsSafeHost;
|
host == expected;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user