Added support for ignoring HTTP errors directly from the Angular $http options
This commit is contained in:
@@ -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');
|
||||
}]);
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user