From ad9ae867c09a7d2f5cecb0e1fa207e9fbab480fa Mon Sep 17 00:00:00 2001 From: Anders Bjerner Date: Thu, 16 Feb 2017 19:22:26 +0100 Subject: [PATCH] Added support for ignoring HTTP errors directly from the Angular $http options --- .../src/common/security/securityinterceptor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js b/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js index e47f0663d8..415cf1e812 100644 --- a/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js +++ b/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js @@ -22,7 +22,7 @@ angular.module('umbraco.security.interceptor') //Here we'll check if we should ignore the error, this will be based on an original header set var headers = originalResponse.config ? originalResponse.config.headers : {}; - if (headers["x-umb-ignore-error"] === "ignore") { + if (headers["x-umb-ignore-error"] === "ignore" || originalResponse.config.umbIgnoreErrors === true) { //exit/ignore return promise; } @@ -99,4 +99,4 @@ angular.module('umbraco.security.interceptor') // We have to add the interceptor to the queue as a string because the interceptor depends upon service instances that are not available in the config block. .config(['$httpProvider', function ($httpProvider) { $httpProvider.responseInterceptors.push('securityInterceptor'); - }]); \ No newline at end of file + }]);