Skip to content
Permalink
Browse files

Add hosting bug workaround

  • Loading branch information...
SteveSandersonMS committed Sep 13, 2019
1 parent 69c82ba commit 309b2076869f8f97c3f8b6c6bc8e34318df16bf5
Showing with 8 additions and 0 deletions.
  1. +8 −0 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<IHttpMaxRequestBodySizeFeature>().MaxRequestBodySize = null;
return next.Invoke();
});

if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();

0 comments on commit 309b207

Please sign in to comment.
You can’t perform that action at this time.