Umbraco-CMS: GetApplicationTrees throws exception after updating to MVC/Web API 5.2.7

Microsoft just released a minor update for MVC 5 and Web API, but after updating from (NuGet version) 5.2.6 to 5.2.7, the following exception occurs when requesting GET /umbraco/backoffice/UmbracoTrees/ApplicationTree/GetApplicationTrees?application=content&tree=&isDialog=false, making the back-office unusable:

Unhandled controller exception occurred System.Web.Http.HttpResponseException: Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.
 at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)
 at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger)
...

The request itself returns a 415 Unsupported Media Type with the following payload:

)]}',
{"Message":"The request contains an entity body but no Content-Type header. The inferred media type 'application/octet-stream' is not supported for this resource.","ExceptionMessage":"No MediaTypeFormatter is available to read an object of type 'FormDataCollection' from content with media type 'application/octet-stream'.","ExceptionType":"System.Net.Http.UnsupportedMediaTypeException","StackTrace":"   at System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent content, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)\r\n   at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)"}

It’s probably also worth noting the Microsoft.AspNet.Cors package is also installed and it only occurs only when the Microsoft.AspNet.WebApi.WebHost package (including dependent Microsoft.AspNet.WebApi) is updated to 5.2.7. Updating all other Microsoft.AspNet.WebApi.* packages to 5.2.7 does not introduce this exception. So there’s probably some change in these 2 packages that causes this exception…

Reproduction

Specifics

  • Umbraco 7.12.4
  • GET /umbraco/backoffice/UmbracoTrees/ApplicationTree/GetApplicationTrees

Steps to reproduce

Update the Microsoft.AspNet.WebApi.WebHost package to 5.2.7.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 26 (21 by maintainers)

Most upvoted comments

I can see this missed the 7.13.2 release…

When is it due to be released?

Thanks!

Thanks, we’ll need to investigate. We have had to make fixes almost every time they release a new version due to some of the proxying we do between controllers.

Have merged, so should be in 7.14