-
Notifications
You must be signed in to change notification settings - Fork 27.5k
feat($httpBackend): add timeout support for JSONP requests #2503
Conversation
Hi @dbinit - Here is the list of things we need to check off before it could be merged. Also I want to check with the core team why this was not included originally. There may be a reason...
|
By the way, you should only have two blank lines in your commit message - one beneath the header and one above the footer. |
Thanks @petebacondarwin, I'm a Google contractor, so don't know if I need to sign the CLA or not... I did just in case (full name: David Bennett). I've updated the commit message. Do I need to submit it to ci.angularjs.org, or do you handle that on merge? |
I can push to CI server but it is having a few timeout issues right now which is why I haven't ticked the box. |
Documentation implies that timeout works for all requests, though it only works with XHR. To implement: - Change $httpBackend to set a timeout for JSONP requests which will immediately resolve the request when fired. - Cancel the timeout when requests are completed.
Any update on this? |
CI server buid is green. Landed at cda7b71. Thanks |
Question! |
@ThomasBurleson, $http checks the status code and rejects the promise if it isn't a success code. See https://github.com/angular/angular.js/blob/master/src/ng/http.js#L939 |
I see that now... and with some application code changes it now works! My 2nd-level reject handler was not being called and I thought the issue was the originating resolve...
Without the Thanks again. |
Documentation implies that timeout works for all requests, though it only works with XHR. Change $httpBackend to set a timeout for JSONP requests which will immediately resolve the request when fired. Completed requests will cancel the timeout.