imagineeasy-angular-http-watcher
Advanced tools
Comparing version 2.1.0 to 2.2.0
{ | ||
"name": "imagineeasy-angular-http-watcher", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Angular HTTP Interceptor to act on failed HTTP request and replay them on a given point in the future", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/easybiblabs/angular-http-watcher", |
@@ -42,6 +42,2 @@ # imagineasy-angular-http-watcher | ||
#### Specifing maximum retries of a http request | ||
You can also limit the number of retries of an HTTP Requests before it gets automatically rejected. By default there is no limit. Setting `maxRetries: 10` will limit retries to 10 times. | ||
#### Specifing custom default values | ||
@@ -48,0 +44,0 @@ |
@@ -29,12 +29,2 @@ module.exports = function($httpProvider) { | ||
if (storeRequest) { | ||
var retries = 0; | ||
if (angular.isDefined(rejection.config.headers['X-RETRIES'])) { | ||
retries = rejection.config.headers['X-RETRIES']; | ||
if (rejection.config.maxRetries === retries) { | ||
return $q.reject(rejection); | ||
} | ||
} | ||
rejection.config.headers['X-RETRIES'] = retries + 1; | ||
var deferred = $q.defer(); | ||
@@ -41,0 +31,0 @@ httpBuffer.append(rejection.config, deferred); |
9662
158
63