-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templates
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
ConsumesAttribute
constructors use GetContentTypes()
to populate the ContentTypes
property and to ensure that no wildcard media types are used:
This effectively forbids declarations like:
[Consumes("text/*")]
public IActionResult SomeAction() { ... }
However, the Accept()
method uses IsSubsetOfAnyContentType()
to check if a request's content type is a subtype of a media type in ContentTypes
:
Expected Behavior
I believe that [Consumes]
should allow wildcard media types, unless there's some side effect that I cannot see. Regardless of wheter [FromBody]
is used or not, just the ability to filter on media subtypes is really useful.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
9.0.305
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templates