[Modify] Polish it

This commit is contained in:
sta 2020-12-28 19:48:27 +09:00
parent 571db9f76a
commit 747361a86f

View File

@ -914,18 +914,23 @@ namespace WebSocketSharp.Server
private void processRequest (HttpListenerWebSocketContext context)
{
var uri = context.RequestUri;
if (uri == null) {
context.Close (HttpStatusCode.BadRequest);
return;
}
var path = uri.AbsolutePath;
if (path.IndexOfAny (new[] { '%', '+' }) > -1)
path = HttpUtility.UrlDecode (path, Encoding.UTF8);
WebSocketServiceHost host;
if (!_services.InternalTryGetServiceHost (path, out host)) {
context.Close (HttpStatusCode.NotImplemented);
return;
}