diff --git a/samples/Sample.Server/Startup.cs b/samples/Sample.Server/Startup.cs index 08fdb76..e6c79c6 100644 --- a/samples/Sample.Server/Startup.cs +++ b/samples/Sample.Server/Startup.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -34,6 +35,13 @@ public void ConfigureServices(IServiceCollection services) // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + // Workaround for https://github.com/aspnet/AspNetCore/issues/13470 + app.Use((context, next) => + { + context.Features.Get().MaxRequestBodySize = null; + return next.Invoke(); + }); + if (env.IsDevelopment()) { app.UseDeveloperExceptionPage();