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 {