public static Func <HttpContext, Func <Task>, Task> RouteInjections(IApplicationBuilder app) { return(async(context, next) => { var envsConfigurations = (MiaEnvsConfigurations)app.ApplicationServices.GetService(typeof(MiaEnvsConfigurations)); var miaHeadersPropagator = new MiaHeadersPropagator(context.Request.Headers, envsConfigurations); ServiceClientFactory.SetMiaHeaders(miaHeadersPropagator); context.Items.Add("MiaHeadersPropagator", miaHeadersPropagator); await next.Invoke(); }); }
public static void SetMiaHeaders(MiaHeadersPropagator miaHeadersPropagator) { _miaHeaders = miaHeadersPropagator.Headers; }