Skip to content

Commit edba494

Browse files
committed
added PATCH and MERGE to AutoInvalidateCacheOutputAttribute
1 parent d705000 commit edba494

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/WebApi.OutputCache.V2/AutoInvalidateCacheOutputAttribute.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ public override void OnActionExecuted(HttpActionExecutedContext actionExecutedCo
2020
if (actionExecutedContext.Response != null && !actionExecutedContext.Response.IsSuccessStatusCode) return;
2121
if (actionExecutedContext.ActionContext.Request.Method != HttpMethod.Post &&
2222
actionExecutedContext.ActionContext.Request.Method != HttpMethod.Put &&
23-
actionExecutedContext.ActionContext.Request.Method != HttpMethod.Delete) return;
23+
actionExecutedContext.ActionContext.Request.Method != HttpMethod.Delete &&
24+
actionExecutedContext.ActionContext.Request.Method.Method.ToLower() != "patch" &&
25+
actionExecutedContext.ActionContext.Request.Method.Method.ToLower() != "merge") return;
2426

2527
var controller = actionExecutedContext.ActionContext.ControllerContext.ControllerDescriptor;
2628
var actions = FindAllGetMethods(controller.ControllerType, TryMatchType ? actionExecutedContext.ActionContext.ActionDescriptor.GetParameters() : null);

0 commit comments

Comments
 (0)