Issue 2624 no content 204 parse (#2641)
Co-authored-by: Paul Young <paul.young@northpoint.com.au>
This commit is contained in:
parent
6aeb03837d
commit
4351f62d46
1 changed files with 5 additions and 1 deletions
|
|
@ -123,7 +123,11 @@ module.exports = function($window, Promise, oncompletion) {
|
|||
if (responseType === "json") {
|
||||
// For IE and Edge, which don't implement
|
||||
// `responseType: "json"`.
|
||||
if (!ev.target.responseType && typeof args.extract !== "function") response = JSON.parse(ev.target.responseText)
|
||||
if (!ev.target.responseType && typeof args.extract !== "function") {
|
||||
// Handle no-content which will not parse.
|
||||
try { response = JSON.parse(ev.target.responseText) }
|
||||
catch (e) { response = null }
|
||||
}
|
||||
} else if (!responseType || responseType === "text") {
|
||||
// Only use this default if it's text. If a parsed
|
||||
// document is needed on old IE and friends (all
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue