Skip to content

Commit

Permalink
Revert changes to Config and move max supported limit to SecurityCont…
Browse files Browse the repository at this point in the history
…roller
  • Loading branch information
david-poindexter committed Sep 8, 2023
1 parent c8714aa commit c4f8c39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion DNN Platform/Library/Common/Utilities/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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") ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down

0 comments on commit c4f8c39

Please sign in to comment.