From deee66c9c0f0547489a319736b7bde496161960a Mon Sep 17 00:00:00 2001 From: Engincan VESKE <43685404+EngincanV@users.noreply.github.com> Date: Fri, 28 Jul 2023 16:49:08 +0300 Subject: [PATCH] Update AbpCorrelationIdMiddleware.cs --- .../Volo/Abp/AspNetCore/Tracing/AbpCorrelationIdMiddleware.cs | 4 ++-- 1 file changed, 2 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 f9df66b2c5..2e78d9f666 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 @@ -29,11 +29,11 @@ public class AbpCorrelationIdMiddleware : IMiddleware, ITransientDependency protected virtual void CheckAndSetCorrelationIdOnResponse( HttpContext httpContext, AbpCorrelationIdOptions options, - string correlationId) + string? correlationId) { httpContext.Response.OnStarting(() => { - if (options.SetResponseHeader && !httpContext.Response.Headers.ContainsKey(options.HttpHeaderName)) + if (options.SetResponseHeader && !httpContext.Response.Headers.ContainsKey(options.HttpHeaderName) && !string.IsNullOrWhiteSpace(correlationId)) { httpContext.Response.Headers[options.HttpHeaderName] = correlationId; }