U4-8103 - fix DisableBrowserCacheAttribute to handle exceptions

This commit is contained in:
Stephan
2016-03-31 16:37:16 +02:00
parent 4cca364511
commit c3055ca43f

View File

@@ -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);
}
}
}
}