[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
5.62k
stars
2.14k
forks
source link
unsupported content types do not elicit a 415 Media Type Unsupported code #8602
Making a request to a web api project which specifies an unsupported content type produces a "400 Bad Request" instead of "415 Media Type Unsupported" response because of the application order of action filters on the default MVC request pipeline. If a content type we can't read is specified, the more specific 415 error should be prioritized and served to the user.
Version of Microsoft.AspNetCore.Mvc or Microsoft.AspNetCore.App or Microsoft.AspNetCore.All:
Is this a Bug or Feature request?:
Bug
Steps to reproduce (preferably a link to a GitHub repo with a repro project):
https://github.com/patrickboe/media_type_bug
Description of the problem:
Making a request to a web api project which specifies an unsupported content type produces a "400 Bad Request" instead of "415 Media Type Unsupported" response because of the application order of action filters on the default MVC request pipeline. If a content type we can't read is specified, the more specific 415 error should be prioritized and served to the user.
Version of
Microsoft.AspNetCore.Mvc
orMicrosoft.AspNetCore.App
orMicrosoft.AspNetCore.All
:Razor.Design 2.1.2