* Resolves the raw $http promise.
(response, status, headers, statusText, xhrStatus)
| 12625 | * Resolves the raw $http promise. |
| 12626 | */ |
| 12627 | function resolvePromise(response, status, headers, statusText, xhrStatus) { |
| 12628 | //status: HTTP response status code, 0, -1 (aborted by timeout / promise) |
| 12629 | status = status >= -1 ? status : 0; |
| 12630 | |
| 12631 | (isSuccess(status) ? deferred.resolve : deferred.reject)({ |
| 12632 | data: response, |
| 12633 | status: status, |
| 12634 | headers: headersGetter(headers), |
| 12635 | config: config, |
| 12636 | statusText: statusText, |
| 12637 | xhrStatus: xhrStatus |
| 12638 | }); |
| 12639 | } |
| 12640 | |
| 12641 | function resolvePromiseWithResult(result) { |
| 12642 | resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus); |
no test coverage detected