From c4f8c39e05b64d2bc0b4d046664459d3e0a425cf Mon Sep 17 00:00:00 2001 From: David Poindexter Date: Fri, 8 Sep 2023 16:58:10 -0400 Subject: [PATCH] Revert changes to Config and move max supported limit to SecurityController --- DNN Platform/Library/Common/Utilities/Config.cs | 4 +++- .../Dnn.PersonaBar.Extensions/Services/SecurityController.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DNN Platform/Library/Common/Utilities/Config.cs b/DNN Platform/Library/Common/Utilities/Config.cs index b1ccfe49c19..83ba6b19af2 100644 --- a/DNN Platform/Library/Common/Utilities/Config.cs +++ b/DNN Platform/Library/Common/Utilities/Config.cs @@ -318,7 +318,8 @@ public static long GetRequestFilterSize(IApplicationStatusInfo appStatus) if (httpNode != null) { - return 4294967295 / 1024 / 1024; // 4GB (max allowedContentLength supported in IIS7) + var maxAllowedContentLength = XmlUtils.GetAttributeValueAsLong(httpNode.CreateNavigator(), "maxAllowedContentLength", 30000000); + return maxAllowedContentLength / 1024 / 1024; } return DefaultRequestFilter; @@ -351,6 +352,7 @@ public static void SetMaxUploadSize(IApplicationStatusInfo appStatus, long newSi if (httpNode != null) { httpNode.Attributes["maxRequestLength"].InnerText = (newSize / 1024).ToString("#"); + httpNode.Attributes["requestLengthDiskThreshold"].InnerText = (newSize / 1024).ToString("#"); } httpNode = configNav.SelectSingleNode("configuration//system.webServer//security//requestFiltering//requestLimits") ?? diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SecurityController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SecurityController.cs index 2327110b166..b57031ce3c3 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SecurityController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/SecurityController.cs @@ -710,7 +710,7 @@ public HttpResponseMessage GetOtherSettings() Host.AutoAccountUnlockDuration, Host.AsyncTimeout, MaxUploadSize = Config.GetMaxUploadSize() / 1024 / 1024, - RangeUploadSize = Config.GetRequestFilterSize(), + RangeUploadSize = 4294967295 / 1024 / 1024, // 4GB (max allowedContentLength supported in IIS7) AllowedExtensionWhitelist = Host.AllowedExtensionWhitelist.ToStorageString(), DefaultEndUserExtensionWhitelist = Host.DefaultEndUserExtensionWhitelist.ToStorageString(), },