From 97665fd27379f97795814db54b7925f94457a7e7 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Fri, 19 Feb 2016 13:46:36 +0200 Subject: [PATCH] Sometimes the content header has charset info --- xhr/xhr.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xhr/xhr.ts b/xhr/xhr.ts index 8f5d95d96..a20d12bff 100644 --- a/xhr/xhr.ts +++ b/xhr/xhr.ts @@ -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; } }