Skip to content

Commit a89677d

Browse files
committed
Allow xhr "retry"
When working with interceptors for authentication (http 401 -> re-authentication -> retry), on the "retry" call, the '__setXHR_' header function has no wrapper anymore. In this case, there is no 'xhr' argument since the function is called directly by angular. Therefore, that function should not be executed (which is not a problem since the events listeners have already been added).
1 parent cd40be3 commit a89677d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dist/angular-file-upload.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ angularFileUpload.service('$upload', ['$http', '$timeout', function($http, $time
2121
if (window.XMLHttpRequest.__isShim) {
2222
config.headers['__setXHR_'] = function() {
2323
return function(xhr) {
24+
if ( ! xhr) return;
2425
config.__XHR = xhr;
2526
config.xhrFn && config.xhrFn(xhr);
2627
xhr.upload.addEventListener('progress', function(e) {

0 commit comments

Comments
 (0)