@@ -1268,9 +1268,9 @@ function $HttpProvider() {
1268
1268
} else {
1269
1269
// serving from cache
1270
1270
if ( isArray ( cachedResp ) ) {
1271
- resolvePromise ( cachedResp [ 1 ] , cachedResp [ 0 ] , shallowCopy ( cachedResp [ 2 ] ) , cachedResp [ 3 ] ) ;
1271
+ resolvePromise ( cachedResp [ 1 ] , cachedResp [ 0 ] , shallowCopy ( cachedResp [ 2 ] ) , cachedResp [ 3 ] , cachedResp [ 4 ] ) ;
1272
1272
} else {
1273
- resolvePromise ( cachedResp , 200 , { } , 'OK' ) ;
1273
+ resolvePromise ( cachedResp , 200 , { } , 'OK' , 'Request Completed' ) ;
1274
1274
}
1275
1275
}
1276
1276
} else {
@@ -1327,18 +1327,18 @@ function $HttpProvider() {
1327
1327
* - resolves the raw $http promise
1328
1328
* - calls $apply
1329
1329
*/
1330
- function done ( status , response , headersString , statusText ) {
1330
+ function done ( status , response , headersString , statusText , xhrStatus ) {
1331
1331
if ( cache ) {
1332
1332
if ( isSuccess ( status ) ) {
1333
- cache . put ( url , [ status , response , parseHeaders ( headersString ) , statusText ] ) ;
1333
+ cache . put ( url , [ status , response , parseHeaders ( headersString ) , statusText , xhrStatus ] ) ;
1334
1334
} else {
1335
1335
// remove promise from the cache
1336
1336
cache . remove ( url ) ;
1337
1337
}
1338
1338
}
1339
1339
1340
1340
function resolveHttpPromise ( ) {
1341
- resolvePromise ( response , status , headersString , statusText ) ;
1341
+ resolvePromise ( response , status , headersString , statusText , xhrStatus ) ;
1342
1342
}
1343
1343
1344
1344
if ( useApplyAsync ) {
@@ -1353,7 +1353,7 @@ function $HttpProvider() {
1353
1353
/**
1354
1354
* Resolves the raw $http promise.
1355
1355
*/
1356
- function resolvePromise ( response , status , headers , statusText ) {
1356
+ function resolvePromise ( response , status , headers , statusText , xhrStatus ) {
1357
1357
//status: HTTP response status code, 0, -1 (aborted by timeout / promise)
1358
1358
status = status >= - 1 ? status : 0 ;
1359
1359
@@ -1362,12 +1362,13 @@ function $HttpProvider() {
1362
1362
status : status ,
1363
1363
headers : headersGetter ( headers ) ,
1364
1364
config : config ,
1365
- statusText : statusText
1365
+ statusText : statusText ,
1366
+ xhrStatus : xhrStatus
1366
1367
} ) ;
1367
1368
}
1368
1369
1369
1370
function resolvePromiseWithResult ( result ) {
1370
- resolvePromise ( result . data , result . status , shallowCopy ( result . headers ( ) ) , result . statusText ) ;
1371
+ resolvePromise ( result . data , result . status , shallowCopy ( result . headers ( ) ) , result . statusText , result . xhrStatus ) ;
1371
1372
}
1372
1373
1373
1374
function removePendingReq ( ) {
0 commit comments