(js) Limit http error interceptor to JSON request
This commit is contained in:
parent
c995c6e9d7
commit
c8539dffa1
|
@ -260,6 +260,7 @@
|
|||
return {
|
||||
responseError: function(rejection) {
|
||||
var deferred, iframe;
|
||||
if (/^application\/json/.test(rejection.config.headers.Accept)) {
|
||||
// Handle CAS ticket renewal (TODO: add check on usesCASAuthentication)
|
||||
if (rejection.status == -1) {
|
||||
deferred = $q.defer();
|
||||
|
@ -274,12 +275,11 @@
|
|||
return deferred.promise;
|
||||
}
|
||||
else {
|
||||
if (/^application\/json/.test(rejection.config.headers.Accept)) {
|
||||
// Broadcast the response error
|
||||
$rootScope.$broadcast('http:Error', rejection);
|
||||
}
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue