/// <summary> /// Invokes the middleware. /// </summary> /// <param name="context">The <see cref="HttpContext" />.</param> public Task Invoke(HttpContext context) { var feature = context.Features.Get <IResponseCookiesFeature>() ?? new ResponseCookiesFeature(context.Features); var wrapper = new ResponseCookiesWrapper(context, Options, feature, _logger); context.Features.Set <IResponseCookiesFeature>(new CookiesWrapperFeature(wrapper)); context.Features.Set <ITrackingConsentFeature>(wrapper); return(_next(context)); }
public CookiesWrapperFeature(ResponseCookiesWrapper wrapper) { Cookies = wrapper; }