Skip to content
Snippets Groups Projects
Commit 6e8b8efe authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

Merge branch 'f-shared-resource-html' into 'dev'

EHN: special handling of html files in shared resource.

See merge request caosdb/caosdb-server!48
parents 3bff75cd 8a0a2707
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