Ejemplo n.º 1
0
        public HttpConnectClient(Uri baseUri, Action <HttpConnectPipelineBuilder> builderAction)
        {
            if (baseUri != null && !baseUri.IsAbsoluteUri)
            {
                throw new ArgumentException("When supplied base uri must be absolute");
            }

            _baseUri  = baseUri;
            _pipeline = ConfigurePipeline(builderAction);
        }
Ejemplo n.º 2
0
        public HttpConnectRequestDelegate Build()
        {
            HttpConnectRequestDelegate pipeline = ctx =>
            {
                ctx.Response = new HttpConnectResponse(HttpStatusCode.NotFound);
                return(Task.CompletedTask);
            };

            foreach (var component in _components.Reverse())
            {
                pipeline = component(pipeline);
            }

            return(pipeline);
        }