public async Task Invoke(HttpContext httpContext)
        {
            if (httpContext == null)
            {
                throw new ArgumentNullException(nameof(httpContext));
            }

            if (!CheckMethod(httpContext.Request.Method, out var serveContent))
            {
                httpContext.Response.StatusCode = (int)HttpStatusCode.NotImplemented;
                return;
            }

            try
            {
                if (await _fileServer.TryServeFile(httpContext, serveContent, httpContext.RequestAborted).ConfigureAwait(false))
                {
                    return;
                }
            }
            catch (OperationCanceledException)
            {
                httpContext.Response.StatusCode = (int)HttpStatusCode.RequestTimeout;
                return;
            }

            await _next.Invoke(httpContext).ConfigureAwait(false);
        }
    public async Task InvokeAsync(HttpContext context, RequestDelegate next)
    {
        try
        {
            if (await _fileServer.TryServeFile(context, CancellationToken.None))
            {
                return;
            }
        }
        catch (OperationCanceledException)
        {
            if (context.Response.HasStarted)
            {
                context.Abort();
            }
            else
            {
                context.Response.StatusCode = StatusCodes.Status408RequestTimeout;
            }

            return;
        }

        await next.Invoke(context);
    }