Extend the IHttpServer interface to avoid the typecasting

This commit is contained in:
Claus Vium
2019-02-26 21:27:02 +01:00
parent f1c93ae618
commit e342b7bc71
3 changed files with 24 additions and 16 deletions

View File

@@ -655,7 +655,7 @@ namespace Emby.Server.Implementations
return;
}
await ((HttpListenerHost)HttpServer).ProcessWebSocketRequest(context).ConfigureAwait(false);
await HttpServer.ProcessWebSocketRequest(context).ConfigureAwait(false);
}
public async Task ExecuteHttpHandlerAsync(HttpContext context, Func<Task> next)
{
@@ -670,7 +670,7 @@ namespace Emby.Server.Implementations
var localPath = context.Request.Path.ToString();
var req = new WebSocketSharpRequest(request, response, request.Path, Logger);
await ((HttpListenerHost)HttpServer).RequestHandler(req, request.GetDisplayUrl(), request.Host.ToString(), localPath, CancellationToken.None).ConfigureAwait(false);
await HttpServer.RequestHandler(req, request.GetDisplayUrl(), request.Host.ToString(), localPath, CancellationToken.None).ConfigureAwait(false);
}
protected virtual IHttpClient CreateHttpClient()