Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 309b207

Browse files
Add hosting bug workaround
1 parent 69c82ba commit 309b207

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

samples/Sample.Server/Startup.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Microsoft.AspNetCore.Components;
88
using Microsoft.AspNetCore.Hosting;
99
using Microsoft.AspNetCore.Http;
10+
using Microsoft.AspNetCore.Http.Features;
1011
using Microsoft.AspNetCore.HttpsPolicy;
1112
using Microsoft.Extensions.Configuration;
1213
using Microsoft.Extensions.DependencyInjection;
@@ -34,6 +35,13 @@ public void ConfigureServices(IServiceCollection services)
3435
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
3536
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
3637
{
38+
// Workaround for https://github.com/aspnet/AspNetCore/issues/13470
39+
app.Use((context, next) =>
40+
{
41+
context.Features.Get<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = null;
42+
return next.Invoke();
43+
});
44+
3745
if (env.IsDevelopment())
3846
{
3947
app.UseDeveloperExceptionPage();

0 commit comments

Comments
 (0)