* Resolves the raw $http promise.
(response, status, headers, statusText, xhrStatus)
| 13352 | * Resolves the raw $http promise. |
| 13353 | */ |
| 13354 | function resolvePromise(response, status, headers, statusText, xhrStatus) { |
| 13355 | //status: HTTP response status code, 0, -1 (aborted by timeout / promise) |
| 13356 | status = status >= -1 ? status : 0; |
| 13357 | |
| 13358 | (isSuccess(status) ? deferred.resolve : deferred.reject)({ |
| 13359 | data: response, |
| 13360 | status: status, |
| 13361 | headers: headersGetter(headers), |
| 13362 | config: config, |
| 13363 | statusText: statusText, |
| 13364 | xhrStatus: xhrStatus |
| 13365 | }); |
| 13366 | } |
| 13367 | |
| 13368 | function resolvePromiseWithResult(result) { |
| 13369 | resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus); |
no test coverage detected