/// <summary> /// Adds minimal asp.net core middlewares for dependency injection, exception handling and logging. It registers following asp.net core middlewares <see cref="AspNetCoreAutofacDependencyInjectionMiddlewareConfiguration"/> /// | <see cref="AspNetCoreExceptionHandlerMiddlewareConfiguration"/> /// | <see cref="AspNetCoreLogRequestInformationMiddlewareConfiguration"/> /// </summary> public static IDependencyManager RegisterMinimalAspNetCoreMiddlewares(this IDependencyManager dependencyManager) { dependencyManager.RegisterAspNetCoreMiddlewareUsing(aspNetCoreApp => { aspNetCoreApp.Use(async(context, next) => { if (context.Request.Path.HasValue) { string path = context.Request.Path.Value; string[] toBeIgnoredPaths = new[] { "/core", "/signalr", "/jobs", "/api" }; if (toBeIgnoredPaths.Any(p => path.StartsWith(p, StringComparison.InvariantCultureIgnoreCase)) || path.EndsWith("$batch", StringComparison.InvariantCultureIgnoreCase)) { IHttpBodyControlFeature httpBodyControlFeature = context.Features.Get <IHttpBodyControlFeature>(); if (httpBodyControlFeature != null) { httpBodyControlFeature.AllowSynchronousIO = true; } } } await next.Invoke(); }); }); dependencyManager.RegisterAspNetCoreMiddlewareUsing(aspNetCoreApp => { aspNetCoreApp.UseMiddleware <AddAcceptCharsetToRequestHeadersIfNotAnyAspNetCoreMiddleware>(); }); dependencyManager.RegisterOwinMiddleware <AspNetCoreAutofacDependencyInjectionMiddlewareConfiguration>(); dependencyManager.RegisterAspNetCoreMiddleware <AspNetCoreExceptionHandlerMiddlewareConfiguration>(); dependencyManager.RegisterAspNetCoreMiddleware <AspNetCoreLogRequestInformationMiddlewareConfiguration>(); return(dependencyManager); }
public Streams(IHttpBodyControlFeature bodyControl, IFrameControl frameControl) { _request = new FrameRequestStream(bodyControl); _emptyRequest = new FrameRequestStream(bodyControl); _response = new FrameResponseStream(bodyControl, frameControl); _upgradeableResponse = new WrappingStream(_response); _upgradeStream = new FrameDuplexStream(_request, _response); }
public Streams(IHttpBodyControlFeature bodyControl, IHttpResponseControl httpResponseControl) { _request = new HttpRequestStream(bodyControl); _emptyRequest = new HttpRequestStream(bodyControl); _response = new HttpResponseStream(bodyControl, httpResponseControl); _upgradeableResponse = new WrappingStream(_response); _upgradeStream = new HttpUpgradeStream(_request, _response); }
public BodyControl(IHttpBodyControlFeature bodyControl, IHttpResponseControl responseControl) { _requestReader = new HttpRequestPipeReader(); _request = new HttpRequestStream(bodyControl, _requestReader); _emptyRequestReader = new HttpRequestPipeReader(); _emptyRequest = new HttpRequestStream(bodyControl, _emptyRequestReader); _responseWriter = new HttpResponsePipeWriter(responseControl); _response = new HttpResponseStream(bodyControl, _responseWriter); _upgradeableResponse = new WrappingStream(_response); _upgradeStream = new HttpUpgradeStream(_request, _response); }
public HttpRequestStream(IHttpBodyControlFeature bodyControl, HttpRequestPipeReader pipeReader) { _bodyControl = bodyControl; _pipeReader = pipeReader; }
public HttpResponseStream(IHttpBodyControlFeature bodyControl, HttpResponsePipeWriter pipeWriter) : base(pipeWriter) { _bodyControl = bodyControl; _pipeWriter = pipeWriter; }
public HttpRequestStream(IHttpBodyControlFeature bodyControl) { _bodyControl = bodyControl; _state = HttpStreamState.Closed; }
public HttpResponseStream(IHttpBodyControlFeature bodyControl, IISHttpContext context) { _bodyControl = bodyControl; _context = context; _state = HttpStreamState.Closed; }
public EmptyStream(IHttpBodyControlFeature bodyControl) { _bodyControl = bodyControl; _state = HttpStreamState.Open; }
public HttpResponseStream(IHttpBodyControlFeature bodyControl, IHttpResponseControl httpResponseControl) { _bodyControl = bodyControl; _httpResponseControl = httpResponseControl; _state = HttpStreamState.Closed; }
public FrameResponseStream(IHttpBodyControlFeature bodyControl, IFrameControl frameControl) { _bodyControl = bodyControl; _frameControl = frameControl; _state = FrameStreamState.Closed; }
public FrameRequestStream(IHttpBodyControlFeature bodyControl) { _bodyControl = bodyControl; _state = FrameStreamState.Closed; }