mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
text/xml responses are now treated as text on iOS (#4531)
fixes github issue 4514
This commit is contained in:

committed by
Alexander Vakrilov

parent
e7d0824421
commit
f092a6ecae
@ -383,3 +383,10 @@ export function test_getResponseHeader() {
|
|||||||
|
|
||||||
TKUnit.assertEqual(xhr.getResponseHeader("Content-Type"), "application/json");
|
TKUnit.assertEqual(xhr.getResponseHeader("Content-Type"), "application/json");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function test_soap_content_types_recognized_as_text() {
|
||||||
|
const xhr = <any>new XMLHttpRequest();
|
||||||
|
|
||||||
|
TKUnit.assertTrue(xhr.isTextContentType("text/xml"), "text/xml failed to be recognized as a text response type");
|
||||||
|
TKUnit.assertTrue(xhr.isTextContentType("application/xml"), "application/xml failed to be recognized as a text response type");
|
||||||
|
};
|
@ -131,7 +131,8 @@ export class XMLHttpRequest {
|
|||||||
private textTypes: string[] = [
|
private textTypes: string[] = [
|
||||||
'text/plain',
|
'text/plain',
|
||||||
'application/xml',
|
'application/xml',
|
||||||
'text/html'
|
'text/html',
|
||||||
|
'text/xml'
|
||||||
];
|
];
|
||||||
|
|
||||||
private isTextContentType(contentType: string): boolean {
|
private isTextContentType(contentType: string): boolean {
|
||||||
|
Reference in New Issue
Block a user