File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ if (window.XMLHttpRequest) {
12
12
xhr . setRequestHeader = ( function ( orig ) {
13
13
return function ( header , value ) {
14
14
if ( header === '__setXHR_' ) {
15
- value ( xhr ) ;
15
+ var val = value ( xhr ) ;
16
+ // fix for angular < 1.2.0
17
+ if ( val instanceof Function ) {
18
+ val ( xhr ) ;
19
+ }
16
20
} else {
17
21
orig . apply ( xhr , arguments ) ;
18
22
}
Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ if (window.XMLHttpRequest) {
14
14
xhr . setRequestHeader = ( function ( orig ) {
15
15
return function ( header , value ) {
16
16
if ( header === '__setXHR_' ) {
17
- value ( xhr ) ;
17
+ var val = value ( xhr ) ;
18
+ // fix for angular < 1.2.0
19
+ if ( val instanceof Function ) {
20
+ val ( xhr ) ;
21
+ }
18
22
} else {
19
23
orig . apply ( xhr , arguments ) ;
20
24
}
@@ -63,7 +67,11 @@ if (window.XMLHttpRequest) {
63
67
xhr . setRequestHeader = ( function ( orig ) {
64
68
return function ( header , value ) {
65
69
if ( header === '__setXHR_' ) {
66
- value ( xhr ) ;
70
+ var val = value ( xhr ) ;
71
+ // fix for angular < 1.2.0
72
+ if ( val instanceof Function ) {
73
+ val ( xhr ) ;
74
+ }
67
75
} else {
68
76
orig . apply ( xhr , arguments ) ;
69
77
}
You can’t perform that action at this time.
0 commit comments