ERR_INVALID_HTTP_RESPONSE using Angular 7 and ASP.Net Core 2.2 in Google Chrome browser

This may have to do with ASP NET Core 2.2 as you figured. There’s an issue registered on GitHub https://github.com/aspnet/AspNetCore/issues/4398

And the work-around is as follows – add the following bit of code in your startup.cs class (I’ve kept this first in Configure method)

app.Use(async (ctx, next) =>
{
  await next();
  if (ctx.Response.StatusCode == 204)
  {
    ctx.Response.ContentLength = 0;
  }
});

Do keep track of the GitHub issue.

Leave a Comment

tech