From ba68655a2dd31a87ebd40234fd2c58701c1f9013 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Mon, 30 Oct 2023 09:27:51 +0100 Subject: [PATCH] Updated condition to add file content if it has mime type text/html --- .../app/rest/repository/MetadataBitstreamRestRepository.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataBitstreamRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataBitstreamRestRepository.java index 4f4ca065cdaa..8208a662ce79 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataBitstreamRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/MetadataBitstreamRestRepository.java @@ -226,7 +226,8 @@ private List getFilePreviewContent(Context context, Bitstream bitstrea private List processInputStreamToFilePreview(Context context, Bitstream bitstream, List fileInfos, InputStream inputStream) throws IOException, SQLException, ParserConfigurationException, SAXException, ArchiveException { - if (bitstream.getFormat(context).getMIMEType().equals("text/plain")) { + String bitstreamMimeType = bitstream.getFormat(context).getMIMEType(); + if (bitstreamMimeType.equals("text/plain") || bitstreamMimeType.equals("text/html")) { String data = getFileContent(inputStream); fileInfos.add(new FileInfo(data, false)); } else {