Browse Source
Update AbpCorrelationIdMiddleware.cs
pull/17224/head
maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
3 additions and
2 deletions
-
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs
|
|
@ -1,4 +1,5 @@ |
|
|
using System; |
|
|
using System; |
|
|
|
|
|
using System.Collections.Generic; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
using Microsoft.AspNetCore.Http; |
|
|
using Microsoft.Extensions.Options; |
|
|
using Microsoft.Extensions.Options; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
@ -29,9 +30,9 @@ public class AbpCorrelationIdMiddleware : IMiddleware, ITransientDependency |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected virtual string GetCorrelationIdFromRequest(HttpContext context) |
|
|
protected virtual string? GetCorrelationIdFromRequest(HttpContext context) |
|
|
{ |
|
|
{ |
|
|
string correlationId = context.Request.Headers[_options.HttpHeaderName]; |
|
|
var correlationId = context.Request.Headers[_options.HttpHeaderName]; |
|
|
if (correlationId.IsNullOrEmpty()) |
|
|
if (correlationId.IsNullOrEmpty()) |
|
|
{ |
|
|
{ |
|
|
correlationId = Guid.NewGuid().ToString("N"); |
|
|
correlationId = Guid.NewGuid().ToString("N"); |
|
|
|