aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/httpBackend.js
AgeCommit message (Collapse)Author
2014-03-14fix($http): don't covert 0 status codes to 404 for non-file protocolsPawel Kozlowski
PR #5547 introduced conversion of all 0 status codes to 404 for cases where no response was recieved (previously this was done for the file:// protocol only). But this mechanism is too eager and masks legitimate cases where status 0 should be returned. This commits reverts to the previous mechanism of handling 0 status code for the file:// protocol (converting 0 to 404) while retaining the returned status code 0 for all the protocols other than file:// Fixes #6074 Fixes #6155
2014-02-18style: remove ws and enfore no-trailing-ws jscs ruleIgor Minar
2014-02-16docs(content): fix bad linksPeter Bacon Darwin
2014-02-16docs(bike-shed-migration): convert doctype and namesPeter Bacon Darwin
2014-02-04fix($http): ignore xhr.responseType setter exception if value is "json"Caitlin Potter
WebKit added support for the json responseType value on 09/03/2013 https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are known to throw when setting the value "json" as the response type. Other older browsers implementing the responseType. Other browsers with infrequent update cycles may also be affected. The json responseType value can be ignored if not supported, because JSON payloads are parsed on the client-side regardless. Closes #6115 Closes #6122
2014-02-04revert: "fix($http): ignore xhr.responseType setter exception if value is ↵Caitlin Potter
"json"" This reverts commit 431bad01835f0294eb159d5b08101d5904828147.
2014-02-04fix($http): ignore xhr.responseType setter exception if value is "json"Caitlin Potter
WebKit added support for the json responseType value on 09/03/2013 https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are known to throw when setting the value "json" as the response type. Other older browsers implementing the responseType. Other browsers with infrequent update cycles may also be affected. The json responseType value can be ignored if not supported, because JSON payloads are parsed on the client-side regardless. Closes #6115 Closes #6122
2014-01-31fix(http): make jshint happyIgor Minar
2014-01-31fix($http): update httpBackend to use ActiveXObject on IE8 if necessaryJorg
window.XMLHttpRequest is not always available in IE8 despite it not running in quirks mode, in which case Angular should be using the ActiveXObject instead. Just checking the browser version is taking too many shortcuts. Closes #5677 Closes #5679
2014-01-10fix($http): return responseText on IE8 for requests with responseType setIgor Minar
Closes #4464 Closes #4738 Closes #5636
2014-01-09fix($httpBackend): Allow status code 0 from any protocolRafał Jagoda
Android 4.1 stock browser also returns status code 0 when a template is loaded via `http` and the application is cached using appcache. Fixes #1356. Closes #5547.
2014-01-08fix($httpBackend): cancelled JSONP requests will not print error in the consoleArtemy Tregubenko
When you cancel a JSONP request, angular deletes the callback for it. However the script still executes, and since the callback is now deleted and undefined, the script throws an exception visible in the console. The quick fix for this is not to delete the callback, but replace it with `angular.noop`. Closes #5615 Closes #5616
2014-01-03style($httpBackend): fix typoBastian Buchholz
2014-01-03fix($httpBackend): don't delete xhr.onreadystatechange otherwise Safari :-OIgor Minar
2014-01-02fix(httpBackend): fix 'type mismatch' error on IE8 after each requestIgor Minar
2014-01-02fix($httpBackend): use ActiveX XHR when making PATCH requests on IE8Igor Minar
IE8's native XHR doesn't support PATCH requests, but the ActiveX one does. I'm also removing the noxhr error doc because nobody will ever get that error. Closes #2518 Closes #5043
2014-01-02fix($httpBackend): Ignore multiple calls to onreadystatechange with readyState=4Tobias Bosch
On mobile webkit `onreadystatechange` might by called multiple times with `readyState===4` caused by xhrs that are resolved while the app is in the background. Fixes #5426.
2013-11-26chore($httpBackend): preserve original non-zero http status code for file:// ↵corrupt
apps Previously if an app was running from file:// origin we would always return either http 200 or 404 depending on whether the response was present. This changes the behavior so that we do this only if the protocol of the request (not the origin) is file:// and only if the status code is 0. Closes #4436 Closes #4587 Closes #4514
2013-11-22chore(style): fix missing indentation in httpBackend from a3172a2Caitlin Potter
2013-11-22fix($httpBackend): only IE8 and below can't use `script.onload` for JSONPPete Bacon Darwin
IE8, IE9 and IE10 can use `script.onreadystate` so up till now we have been using this if the sniffer says we are on IE. But IE11 now does not support `script.onreadystate` and only supports the more standard `script.onload` and `script.onerror`. IE9 and IE10 do support `script.onload` and `script.onerror`. So now we only test whether we are on IE8 or earlier before using `script.onreadystate`. See http://pieisgood.org/test/script-link-events/ jQuery just uses all these handlers at once and hopes for the best, but since IE9 and IE10 support both sets of handlers, this could cause the handlers to be run more than once. jQuery also notes that there is a potential memory leak in IE unless we remove the handlers from the script object once they are run. So we are doing this too, now. Closes #4523 Closes #4527 Closes #4922
2013-11-21fix(httpBackend): should not read response data when request is abortedGonzalo Ruiz de Villa
When a request is aborted, it makes no sense to read the response headers or text. Also in IE9, trying to read data (either response headers or text) from an aborted request throws an Error c00c023f. Fixes #4913 Closes #4940
2013-10-22style: make jshint happyVojta Jina
2013-10-10refactor(location): $location now uses urlUtils, not RegExJeff Cross
The location service, and other portions of the application, were relying on a complicated regular expression to get parts of a URL. But there is already a private urlUtils provider, which relies on HTMLAnchorElement to provide this information, and is suitable for most cases. In order to make urlUtils more accessible in the absence of DI, its methods were converted to standalone functions available globally. The urlUtils.resolve method was renamed urlResolve, and was refactored to only take 1 argument, url, and not the 2nd "parse" boolean. The method now always returns a parsed url. All places in code which previously wanted a string instead of a parsed url can now get the value from the href property of the returned object. Tests were also added to ensure IPv6 addresses were handled correctly. Closes #3533 Closes #2950 Closes #3249
2013-10-01fix($httpBackend): set headers with falsy valuesRicardo Bin
This is a breaking change. To migrate to the new behavior, delete or set headers to `undefined` to avoid having them sent. To restore the old behavior, override `$httpBackendProvider` with the old implementation. Closes #2984
2013-10-01fix($httpBackend): don't send empty string bodiesJames Roper
The `XMLHttpRequest.send` spec defines different semantics for `null` than for an empty String: an empty String should be sent with a `Content-Type` of `text/plain`, whereas `null` should have no `Content-Type` header set. Closes #2149
2013-10-01chore: remove Firefox CORS workaroundjquadrin
See #1468
2013-06-17chore(minErr): replace ngError with minErrKen Sheedlo
2013-05-24feat(ngError): add error message compression and better error messagesIgor Minar
- add toThrowNg matcher
2013-05-20feat($http): add support for aborting via timeout promisesDavid Bennett
If the timeout argument is a promise, abort the request when it is resolved. Implemented by adding support to $httpBackend service and $httpBackend mock service. This api can also be used to explicitly abort requests while keeping the communication between the deffered and promise unidirectional. Closes #1159
2013-04-30feat($httpBackend): add timeout support for JSONP requestsDavid Bennett
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.
2013-04-15fix($location): fix URL interception in hash-bang modeMisko Hevery
Closes #1051
2013-02-23fix($httpBackend): prevent DOM err due to dereferencing .responseTextIgor Minar
If responseType is defined and the request fails for one reason or another the .response property returned falsy value which caused dereferencing of .responseText. If the responseType was a blob or document then an error was thrown. To prevent this, I'm checking for responseType first and based on that dereferencing .response or .responseText. We need to keep on checking .responseText because that's the original XHR response api that is still needed for IE8 and 9. Closes #1922
2013-02-14fix($httpBackend): patch for Firefox bug w/ CORS and response headersWill Moore
A workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=608735 In FF getAllResponseHeaders() returns null if the request is the result of CORS. Tried to format the code so that when a FF patch is released and gains enough traction it can easily be selected and deleted. Heavily inspired by jQuery's patch for the same bug. This patch falls short of passing through custom headers but covers all of the "simple response headers" in the spec at http://www.w3.org/TR/cors/ This commit should get reverted once Firefox 21 gets out. Closes #1468
2012-08-10feat($http): support reponseTypeVojta Jina
Closes #1013
2012-06-12docs(*): simplify doc urlsIgor Minar
we now have two types of namespaces: - true namespace: angular.* - used for all global apis - virtual namespace: ng.*, ngMock.*, ... - used for all DI modules the virual namespaces have services under the second namespace level (e.g. ng.) and filters and directives prefixed with filter: and directive: respectively (e.g. ng.filter:orderBy, ng.directive:ngRepeat) this simplifies urls and makes them a lot shorter while still avoiding name collisions
2012-04-10chore(*): remove dead code and fix code style issuesIgor Minar
2012-04-09chore($browser): remove the addJs methodIgor Minar
this was never meant to be a public api used by apps. I refactored the code to hide the functionality. BREAKING CHANGE: $browser.addJs method was removed apps that depended on this functionality should either use many of the existing script loaders or create a simple helper method specific to the app.
2012-04-04feat($http): add withCredentials config optionVojta Jina
2012-03-28chore(Rakefile): get ready for modulesMisko Hevery
2012-03-28chore(module): move files around in preparation for more modulesMisko Hevery