London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
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?