mirror of
https://github.com/AlexMacocian/Net.Sdk.Web.Extensions.git
synced 2026-07-22 16:59:30 +00:00
Add CV to response
This commit is contained in:
@@ -18,7 +18,7 @@ public sealed class CorrelationVectorMiddleware : IMiddleware
|
||||
this.options = options.ThrowIfNull().Value.ThrowIfNull();
|
||||
}
|
||||
|
||||
public Task InvokeAsync(HttpContext context, RequestDelegate next)
|
||||
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
|
||||
{
|
||||
var cv = new CorrelationVector();
|
||||
if (context.Items.TryGetValue(this.options.Header, out var correlationVectorVal) &&
|
||||
@@ -29,6 +29,8 @@ public sealed class CorrelationVectorMiddleware : IMiddleware
|
||||
}
|
||||
|
||||
context.SetCorrelationVector(cv);
|
||||
return next(context);
|
||||
await next(context);
|
||||
|
||||
context.Response.Headers.Append(this.options.Header, context.GetCorrelationVector().ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<OutputType>Library</OutputType>
|
||||
<IsPackable>true</IsPackable>
|
||||
<Version>0.6</Version>
|
||||
<Version>0.6.1</Version>
|
||||
<Authors>Alexandru Macocian</Authors>
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||
|
||||
Reference in New Issue
Block a user