-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Correct polarity of MediaTypeHeaderValue.IsSubsetOf()` checks and remove one conneg fallback #3317
Conversation
…ove one conneg fallback - #3138 part 2/2 - request's Content-Type header must be a subset of what an `IInputFormatter` can consume - `[Consumes]` is similar - what an `IOutputFormatter` produces must be a subset of the request's Accept header - `FormatFilter` and `ObjectResult` are similar - `ObjectResult` no longer falls back to `Content-Type` header if no `Accept` value is acceptable - left `WebApiCompatShim` code alone for consistency with down-level `System.Net.Http.Formatting` - correct tests to match new behaviour - do not test `Accept` values containing a `charset` parameter; that case is not valid WIP: - four test failures; something about comparing media types w/ charset included - why do some localization tests fail in VS? nits: - add `InputFormatterTests` - add / update comments and doc comments - correct xUnit attributes in `ActionResultTest`; odd it doesn't show up in command-line runs
@@ -25,7 +25,8 @@ | |||
"Microsoft.Extensions.PropertyHelper.Sources": { | |||
"version": "1.0.0-*", | |||
"type": "build" | |||
} | |||
}, | |||
"Microsoft.Net.Http.Headers": "1.0.0-*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this change from the first commit. Did this only to ensure build picks up the local changes to HttpAbstractions
.
No |
I talked to @dougbu this does still need to be reviewed. |
@@ -56,10 +56,10 @@ public void OnResourceExecuting(ResourceExecutingContext context) | |||
MediaTypeHeaderValue requestContentType = null; | |||
MediaTypeHeaderValue.TryParse(context.HttpContext.Request.ContentType, out requestContentType); | |||
|
|||
// Only execute if this is the last filter before calling the action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this comment go with another block in this method? Your new comment is great, but methinks the previous comment wandered away from home.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a duplicate comment. Open your window on this diff just a bit wider, look at https://github.com/aspnet/Mvc/pull/3317/files#diff-1b5675f1b083c83b1f98dd3e87cf08f6R52
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
⌚ |
Reopening so we can more-easily see this discussion 'til it completes. |
|
@rynowak know you've signed off. But I'd like your opinion on method renaming in new 3rd commit. Addressed other comments as well. |
AppVeyor and Travis should fail here. Pushed |
Name change is a small improvement over what we have IMO. You should go ahead with your changes and we can discuss when you're in the office. |
Comments addressed in 9b00461 |
IInputFormatter
can consume[Consumes]
is similarIOutputFormatter
produces must be a subset of the request's Accept headerFormatFilter
andObjectResult
are similarObjectResult
no longer falls back toContent-Type
header if noAccept
value is acceptableWebApiCompatShim
code alone for consistency with down-levelSystem.Net.Http.Formatting
Accept
values containing acharset
parameter; that case is not validnits:
InputFormatterTests
ActionResultTest
; odd it doesn't show up in command-line runs