From 84f3a49f94ec1b0727c28145f8288094a47e814f Mon Sep 17 00:00:00 2001 From: Rolf Kristensen Date: Sun, 6 Aug 2023 17:53:24 +0200 Subject: [PATCH] Better diagnostics when missing HttpModule or MiddleWare - Fixed code smells (#980) --- .../LayoutRenderers/AspNetRequestPostedBodyLayoutRenderer.cs | 2 +- src/Shared/Targets/Wrappers/AspNetBufferingTargetWrapper.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Shared/LayoutRenderers/AspNetRequestPostedBodyLayoutRenderer.cs b/src/Shared/LayoutRenderers/AspNetRequestPostedBodyLayoutRenderer.cs index c676abfa..19f0ae1e 100644 --- a/src/Shared/LayoutRenderers/AspNetRequestPostedBodyLayoutRenderer.cs +++ b/src/Shared/LayoutRenderers/AspNetRequestPostedBodyLayoutRenderer.cs @@ -18,7 +18,7 @@ namespace NLog.Web.LayoutRenderers [LayoutRenderer("aspnet-request-posted-body")] public class AspNetRequestPostedBodyLayoutRenderer : AspNetLayoutRendererBase { - internal static bool MiddlewareInstalled; + internal static bool MiddlewareInstalled { get; set; } /// /// The object for the key in HttpContext.Items for the POST request body diff --git a/src/Shared/Targets/Wrappers/AspNetBufferingTargetWrapper.cs b/src/Shared/Targets/Wrappers/AspNetBufferingTargetWrapper.cs index 033968d2..a51d8b89 100644 --- a/src/Shared/Targets/Wrappers/AspNetBufferingTargetWrapper.cs +++ b/src/Shared/Targets/Wrappers/AspNetBufferingTargetWrapper.cs @@ -74,7 +74,7 @@ namespace NLog.Web.Targets.Wrappers [Target("AspNetBufferingWrapper", IsWrapper = true)] public class AspNetBufferingTargetWrapper : WrapperTargetBase { - internal static bool MiddlewareInstalled; + internal static bool MiddlewareInstalled { get; set; } private static readonly object dataSlot = new object(); private int _bufferGrowLimit;