/// <summary>
        /// Triggered when a non-websocket request available.
        /// </summary>
        private async Task RequestAsync(IHorseServer server, HttpRequest request, HttpResponse response)
        {
            IServiceScope scope = Mvc.ServiceProvider.CreateScope();

            try
            {
                if (App.Descriptors.Count > 0)
                {
                    MiddlewareRunner runner = new MiddlewareRunner(scope);
                    await runner.RunSequence(App, request, response);

                    if (runner.LastResult != null)
                    {
                        WriteResponse(response, runner.LastResult);
                        return;
                    }
                }

                await RequestMvc(server, request, response, scope);
            }
            catch (Exception ex)
            {
                if (Mvc.IsDevelopment)
                {
                    IErrorHandler handler = new DevelopmentErrorHandler();
                    IActionResult result  = await handler.Error(request, ex);

                    WriteResponse(request.Response, result);
                }
                else if (Mvc.ErrorHandler != null)
                {
                    IActionResult result = await Mvc.ErrorHandler.Error(request, ex);

                    WriteResponse(request.Response, result);
                }
                else
                {
                    WriteResponse(request.Response, StatusCodeResult.InternalServerError());
                }

                if (request.Response.StreamSuppressed && request.Response.ResponseStream != null)
                {
                    GC.ReRegisterForFinalize(request.Response.ResponseStream);
                }
            }
            finally
            {
                scope.Dispose();
            }
        }