From 41984bed1302f5c8bd898c9d1772357f67363194 Mon Sep 17 00:00:00 2001 From: Pierre Villard Date: Wed, 16 Aug 2017 18:30:20 +0200 Subject: [PATCH] NIFI-1835 - added text/xml to content viewer Signed-off-by: Scott Aslan This closes #2098 --- .../org/apache/nifi/web/StandardContentViewerController.java | 3 ++- .../src/main/webapp/META-INF/nifi-content-viewer | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java index cf532c3a28..405b11c007 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/java/org/apache/nifi/web/StandardContentViewerController.java @@ -53,6 +53,7 @@ public class StandardContentViewerController extends HttpServlet { static { supportedMimeTypes.add("application/json"); supportedMimeTypes.add("application/xml"); + supportedMimeTypes.add("text/xml"); supportedMimeTypes.add("text/plain"); supportedMimeTypes.add("text/csv"); supportedMimeTypes.add("application/avro-binary"); @@ -85,7 +86,7 @@ public class StandardContentViewerController extends HttpServlet { final ObjectMapper mapper = new ObjectMapper(); final Object objectJson = mapper.readValue(content.getContentStream(), Object.class); formatted = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(objectJson); - } else if ("application/xml".equals(contentType)) { + } else if ("application/xml".equals(contentType) || "text/xml".equals(contentType)) { // format xml final StringWriter writer = new StringWriter(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/webapp/META-INF/nifi-content-viewer b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/webapp/META-INF/nifi-content-viewer index e5e25f0f9f..f105ca2f0b 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/webapp/META-INF/nifi-content-viewer +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-content-viewer/src/main/webapp/META-INF/nifi-content-viewer @@ -14,6 +14,7 @@ # limitations under the License. application/xml application/json +text/xml text/plain text/csv avro/binary