-
Notifications
You must be signed in to change notification settings - Fork 27.5k
feat($http): add xhr statusText to completeRequest callback #6713
Conversation
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
OK, looks good to me. But I think in 2.0 we should be passing around some kind of object rather than having to code up each parameter individually. |
@@ -148,12 +149,19 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc | |||
// while retrieving files from application cache. | |||
if (status === 0) { | |||
status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0; | |||
|
|||
if (!statusText) { | |||
statusText = status === 200 ? 'OK' : status === 404 ? 'Not Found' : 'Error'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why should we do this? if there was no status text (which is rare) then we should not try to correct that IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if we move this to the ngMock code?
the rest looks good |
Makes xhr status text accessible is $http success/error callback. See www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-statustext Closes angular#2335
lgtm |
Thanks Igor, I'll merge today |
Makes xhr status text accessible is $http success/error callback. See www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-statustext Closes #2335 Closes #2665 Closes #6713
Makes xhr status text accessible is $http success/error callback. See
www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-statustext
(This is just a rebased version of the other PR (#2665), meant to fix the bitrot so it can be merged.
Review is needed!)
Closes #2335
Closes #2665