[Modify] Polish it
This commit is contained in:
parent
571db9f76a
commit
747361a86f
@ -914,18 +914,23 @@ namespace WebSocketSharp.Server
|
|||||||
private void processRequest (HttpListenerWebSocketContext context)
|
private void processRequest (HttpListenerWebSocketContext context)
|
||||||
{
|
{
|
||||||
var uri = context.RequestUri;
|
var uri = context.RequestUri;
|
||||||
|
|
||||||
if (uri == null) {
|
if (uri == null) {
|
||||||
context.Close (HttpStatusCode.BadRequest);
|
context.Close (HttpStatusCode.BadRequest);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var path = uri.AbsolutePath;
|
var path = uri.AbsolutePath;
|
||||||
|
|
||||||
if (path.IndexOfAny (new[] { '%', '+' }) > -1)
|
if (path.IndexOfAny (new[] { '%', '+' }) > -1)
|
||||||
path = HttpUtility.UrlDecode (path, Encoding.UTF8);
|
path = HttpUtility.UrlDecode (path, Encoding.UTF8);
|
||||||
|
|
||||||
WebSocketServiceHost host;
|
WebSocketServiceHost host;
|
||||||
|
|
||||||
if (!_services.InternalTryGetServiceHost (path, out host)) {
|
if (!_services.InternalTryGetServiceHost (path, out host)) {
|
||||||
context.Close (HttpStatusCode.NotImplemented);
|
context.Close (HttpStatusCode.NotImplemented);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user