mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Merge pull request #1589 from NativeScript/feature/xhr-json-fix
FIX: XHR json response sometimes is not paresed.
This commit is contained in:
@ -118,9 +118,9 @@ export class XMLHttpRequest {
|
||||
private _setResponseType() {
|
||||
const contentType = this.getResponseHeader('Content-Type').toLowerCase();
|
||||
|
||||
if (contentType === 'application/json') {
|
||||
if (contentType.indexOf('application/json') >= 0) {
|
||||
this.responseType = XMLHttpRequestResponseType.json;
|
||||
} else if (contentType === 'text/plain') {
|
||||
} else if (contentType.indexOf('text/plain') >= 0) {
|
||||
this.responseType = XMLHttpRequestResponseType.text;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user