From a56288753c94e681cf010a1f1bc50b73cb0a56f0 Mon Sep 17 00:00:00 2001 From: maliming Date: Sat, 29 Jul 2023 10:02:27 +0800 Subject: [PATCH] Update AbpCorrelationIdMiddleware.cs --- .../Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs index de93914d71..a5f954c260 100644 --- a/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs +++ b/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Options; 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()) { correlationId = Guid.NewGuid().ToString("N");