ASP.NET Core middleware to propagate HTTP headers from the incoming request to the outgoing HTTP Client requests. This is a backport to ASP.NET Core 2.1 (and 2.2) of the ASP.NET Core HeaderPropagation middleware I had recently contributed to the ASP.NET Core project.
Apache License 2.0
31
stars
1
forks
source link
Is the HeaderPropagationValues safe to use when injected in controller? #11
I need to access a Correlation ID that is fetched from the request header or is generated.
Since HeaderPropagationValues uses AsyncLocals to store the header values and that there is a bug which causes AsyncLocals to bleed across requests, is it safe to use HeaderPropagationValues when injected in a controller?
Yes, it is safe to use it.
Version 3.0.2 includes a workaround to avoid that issue, so no matter in which position of the pipeline you add the middleware, you will not be affected.
I need to access a Correlation ID that is fetched from the request header or is generated.
Since
HeaderPropagationValues
uses AsyncLocals to store the header values and that there is a bug which causesAsyncLocal
s to bleed across requests, is it safe to useHeaderPropagationValues
when injected in a controller?