From 782542ee386dfb9f5e6bd71f0875e37af0cd55ba Mon Sep 17 00:00:00 2001 From: Jon Nolen Date: Thu, 6 Dec 2018 17:13:49 -0500 Subject: [PATCH] Update TypeMatchFilter.cs should only be typechecking on json api requests that are patch or post... because of left to right evaluation and lack of parens this was evaluating as false || is post if the request was not a jsonapi request. --- src/JsonApiDotNetCore/Middleware/TypeMatchFilter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/JsonApiDotNetCore/Middleware/TypeMatchFilter.cs b/src/JsonApiDotNetCore/Middleware/TypeMatchFilter.cs index 66a5103ce4..64624dfa70 100644 --- a/src/JsonApiDotNetCore/Middleware/TypeMatchFilter.cs +++ b/src/JsonApiDotNetCore/Middleware/TypeMatchFilter.cs @@ -22,7 +22,7 @@ public TypeMatchFilter(IJsonApiContext jsonApiContext) public void OnActionExecuting(ActionExecutingContext context) { var request = context.HttpContext.Request; - if (IsJsonApiRequest(request) && request.Method == "PATCH" || request.Method == "POST") + if (IsJsonApiRequest(request) && (request.Method == "PATCH" || request.Method == "POST")) { var deserializedType = context.ActionArguments.FirstOrDefault().Value?.GetType(); var targetType = context.ActionDescriptor.Parameters.FirstOrDefault()?.ParameterType;