Skip to content
Snippets Groups Projects
Verified Commit 8a0a2707 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

EHN: special handling of html files in shared resource.

The shared resource returns files of all media types as download
attachments except for HTML files, which should be opened by the browser
directly.
parent 3bff75cd
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,12 @@ public class SharedFileResource extends AbstractCaosDBServerResource {
final MediaType mt = MediaType.valueOf(FileUtils.getMimeType(file));
final FileRepresentation ret = new FileRepresentation(file, mt);
ret.setDisposition(new Disposition(Disposition.TYPE_ATTACHMENT));
// HTML files should be opened in the browser.
// Any other media type than HTML is attached for download.
if (!MediaType.TEXT_HTML.includes(mt)) {
ret.setDisposition(new Disposition(Disposition.TYPE_ATTACHMENT));
}
return ret;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment