From c3055ca43fc6f10ee8b79ad89599c189cfac1fcd Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 31 Mar 2016 16:37:16 +0200 Subject: [PATCH] U4-8103 - fix DisableBrowserCacheAttribute to handle exceptions --- .../Filters/DisableBrowserCacheAttribute.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs b/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs index e1890326fb..0bb283bd1a 100644 --- a/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs @@ -1,15 +1,6 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; using System.Net.Http.Headers; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Web; -using System.Web.Http.Controllers; using System.Web.Http.Filters; -using Umbraco.Core; namespace Umbraco.Web.WebApi.Filters { @@ -24,6 +15,9 @@ namespace Umbraco.Web.WebApi.Filters base.OnActionExecuted(actionExecutedContext); + // happens if exception + if (actionExecutedContext.Response == null) return; + //NOTE: Until we upgraded to WebApi 2, this didn't work correctly and we had to revert to using // HttpContext.Current responses. I've changed this back to what it should be now since it works // and now with WebApi2, the HttpContext.Current responses dont! Anyways, all good now. @@ -42,9 +36,6 @@ namespace Umbraco.Web.WebApi.Filters //Mon, 01 Jan 1990 00:00:00 GMT new DateTimeOffset(1990, 1, 1, 0, 0, 0, TimeSpan.Zero); } - - - } } }