mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
revert: "fix($http): ignore xhr.responseType setter exception if value is "json""
This reverts commit 431bad0183.
This commit is contained in:
parent
431bad0183
commit
058842ad04
1 changed files with 2 additions and 15 deletions
|
|
@ -106,21 +106,8 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
|
|||
xhr.withCredentials = true;
|
||||
}
|
||||
|
||||
if (responseType && isString(xhr.responseType)) {
|
||||
try {
|
||||
xhr.responseType = responseType;
|
||||
} catch (e) {
|
||||
// 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
|
||||
//
|
||||
// The json response type can be ignored if not supported, because JSON payloads are
|
||||
// parsed on the client-side regardless.
|
||||
if (responseType !== 'json') {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (responseType) {
|
||||
xhr.responseType = responseType;
|
||||
}
|
||||
|
||||
xhr.send(post || null);
|
||||
|
|
|
|||
Loading…
Reference in a new issue