Closed brandonroberts closed 9 years ago
:+1:
Awesome pull request @brandonroberts and with tests! I'll be reviewing this soon and merging it in to the main branch.
@brandonroberts Great work! Ran in to this problem yesterday. Doesnt look like it deals with the response equivalent?
@deyceg I believe the response equivalent is already being handled. If no mock is provided it just returns the $http promise, and if a mock is provided its wrapped in a promise which will be resolved once the request is made.
@brandonroberts Thats correct!
The call to getTransformedResponse is assuming that the response is just an object, and after the interceptors have been applied it still assumes its an object, but one of the interceptors may return a $promise containing a response object instead
@deyceg Ok. the PR has been updated to handle response promises also.
Bump? @atecarlos
Hi @brandonroberts . This weekend I have set aside some time to work through this and get it merged in. Thanks again for the PR.
Interceptors can return a config object, or a promise that resolves a config object. This adds support for handling either scenario before returning the response promise.