AI OnAI Off
After spending more time in Application Insights I found that for us, this only occurred on POST requests (and also a few HEAD requests were sent and triggered it too) and when a controller was missing those attributes.
Not sure on the exact point that triggered the error but it was somewhere later in the middleware processing when MVC hadn't picked up up the route+HTTP-method combo.
Something similar to this will roll out... Can't reproduce locally with this change.
Would like to have global fix that also sends content-length header but haven't solved that yet.
[HttpGet]
[HttpHead] // <= added
[HttpPost] // <= added
public Microsoft.AspNetCore.Mvc.ActionResult Index(StartPageType currentPage)
{
if (string.Equals(this.HttpContext.Request.Method, "HEAD", StringComparison.OrdinalIgnoreCase)) // <= added
{
return new StatusCodeResult(200);
}
var model = CreateModel(currentPage);
return View(model);
}
Anyone looked into errors like this one and know something?