Add RssFeed to the ContentTypes considered as text (#4820)

This commit is contained in:
Emil Tabakov
2017-09-09 15:45:07 +03:00
committed by Alexander Vakrilov
parent 9ad297f2d7
commit 2f0d3b0e0b
2 changed files with 20 additions and 0 deletions

View File

@@ -267,6 +267,25 @@ export function test_xhr_events() {
TKUnit.assertEqual(errorEventData, 'error data');
}
export function test_xhr_responseType_rss() {
const xhr = <any>new XMLHttpRequest();
const rawRssFeed = '<rss> <channel><item><title>Test</title></item></channel></rss>';
const response = {
statusCode: 200,
content: {
toString: function(){ return this.raw },
raw: rawRssFeed
},
headers: {
"Content-Type": "application/rss+xml"
}
}
xhr._loadResponse(response);
TKUnit.assertEqual(xhr.responseType, "text");
TKUnit.assertEqual(xhr.response, rawRssFeed);
}
export function test_xhr_responseType_text() {
const xhr = <any>new XMLHttpRequest();
const response = {

View File

@@ -131,6 +131,7 @@ export class XMLHttpRequest {
private textTypes: string[] = [
'text/plain',
'application/xml',
'application/rss+xml',
'text/html',
'text/xml'
];