Ejemplo n.º 1
0
        public async Task InvokeAsync(PipelineContext context, PipelineDelegate next)
        {
            if (!context.GetFirst(out HttpContext httpContext))
            {
                throw new PipelineDependencyException <HttpContext>(this);
            }

            PipelineConverters.Convert(httpContext.Request, out HttpRequestMessage httpRequestMessage, HeadersToRemove);
            context
            .Add(httpRequestMessage)
            .Add(httpContext.RequestAborted);

            await next.Invoke();
        }
Ejemplo n.º 2
0
        public async Task InvokeAsync(PipelineContext context, PipelineDelegate next)
        {
            await next.Invoke();

            if (!context.GetFirst(out HttpContext httpContext))
            {
                throw new PipelineDependencyException <HttpContext>(this);
            }

            if (!context.GetFirst(out HttpResponseMessage httpResponseMessage))
            {
                throw new PipelineDependencyException <HttpResponseMessage>(this);
            }

            await PipelineConverters.Convert(httpResponseMessage, httpContext.Response, HeadersToRemove);
        }