protected internal override HttpResponse HandleRequest(TestContext ctx, HttpConnection connection, HttpRequest request, RequestFlags effectiveFlags)
        {
            string authHeader;

            if (!request.Headers.TryGetValue("Authorization", out authHeader))
            {
                authHeader = null;
            }

            var response = manager.HandleAuthentication(request, authHeader);

            if (response != null)
            {
                return(response);
            }

            return(Target.HandleRequest(ctx, connection, request, effectiveFlags));
        }
Beispiel #2
0
        protected internal override async Task <HttpResponse> HandleRequest(
            TestContext ctx, HttpConnection connection, HttpRequest request,
            RequestFlags effectiveFlags, CancellationToken cancellationToken)
        {
            string authHeader;

            if (!request.Headers.TryGetValue("Authorization", out authHeader))
            {
                authHeader = null;
            }

            var response = manager.HandleAuthentication(connection, request, authHeader);

            if (response != null)
            {
                return(response);
            }

            cancellationToken.ThrowIfCancellationRequested();
            return(await Target.HandleRequest(ctx, connection, request, effectiveFlags, cancellationToken));
        }