enable XMLTextFormatter for application/xml and text/xml

Summary:
Currently in the Flipper network plugin implementation, XMLTextFormatter is only enabled if `content-type` is `text/html`.

We should enable it for `application/xml` and `text/xml` as well.

Reviewed By: mweststrate

Differential Revision: D37733487

fbshipit-source-id: f272c5d0a305cf4afd32701d40459c3e11049886
This commit is contained in:
Shipeng Xu
2022-07-11 10:29:42 -07:00
committed by Facebook GitHub Bot
parent 18854ce5fc
commit 4daa1d41db

View File

@@ -470,7 +470,11 @@ class XMLTextFormatter {
}
format(body: string, contentType: string) {
if (contentType.startsWith('text/html')) {
if (
contentType.startsWith('text/html') ||
contentType.startsWith('text/xml') ||
contentType.startsWith('application/xml')
) {
return <XMLText body={body} />;
}
}