Browse Source
Update AbpCorrelationIdMiddleware.cs
pull/17224/head
maliming
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
3 deletions
-
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs
|
|
|
@ -21,9 +21,12 @@ public class AbpCorrelationIdMiddleware : IMiddleware, ITransientDependency |
|
|
|
|
|
|
|
public async Task InvokeAsync(HttpContext context, RequestDelegate next) |
|
|
|
{ |
|
|
|
var correlationId = _correlationIdProvider.Get(); |
|
|
|
CheckAndSetCorrelationIdOnResponse(context, _options, correlationId); |
|
|
|
await next(context); |
|
|
|
var correlationId = GetCorrelationIdFromRequest(context); |
|
|
|
using (_correlationIdProvider.Change(correlationId)) |
|
|
|
{ |
|
|
|
CheckAndSetCorrelationIdOnResponse(context, _options, correlationId); |
|
|
|
await next(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual void CheckAndSetCorrelationIdOnResponse( |
|
|
|
|