mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Add RssFeed to the ContentTypes considered as text (#4820)
This commit is contained in:
committed by
Alexander Vakrilov
parent
9ad297f2d7
commit
2f0d3b0e0b
@@ -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 = {
|
||||
|
||||
@@ -131,6 +131,7 @@ export class XMLHttpRequest {
|
||||
private textTypes: string[] = [
|
||||
'text/plain',
|
||||
'application/xml',
|
||||
'application/rss+xml',
|
||||
'text/html',
|
||||
'text/xml'
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user