* Run code cleanup * Run dotnet format * Start manual cleanup in Web.Common * Finish up manual cleanup * Fix tests * Fix up InMemoryModelFactory.cs * Inject proper macroRenderer * Update src/Umbraco.Web.Common/Filters/JsonDateTimeFormatAttribute.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Update src/Umbraco.Web.Common/Filters/ValidateUmbracoFormRouteStringAttribute.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Fix based on review Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk> Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
21 lines
800 B
C#
21 lines
800 B
C#
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
|
using Microsoft.Extensions.Options;
|
|
using Umbraco.Cms.Core.Configuration.Models;
|
|
|
|
namespace Umbraco.Cms.Web.Common.Security;
|
|
|
|
public class ConfigureKestrelServerOptions : IConfigureOptions<KestrelServerOptions>
|
|
{
|
|
private readonly IOptions<RuntimeSettings> _runtimeSettings;
|
|
|
|
public ConfigureKestrelServerOptions(IOptions<RuntimeSettings> runtimeSettings) =>
|
|
_runtimeSettings = runtimeSettings;
|
|
|
|
public void Configure(KestrelServerOptions options) =>
|
|
|
|
// convert from KB to bytes, 52428800 bytes (50 MB) is the same as in the IIS settings
|
|
options.Limits.MaxRequestBodySize = _runtimeSettings.Value.MaxRequestLength.HasValue
|
|
? _runtimeSettings.Value.MaxRequestLength.Value * 1024
|
|
: 52428800;
|
|
}
|