Skip to content
Snippets Groups Projects
Commit 98452d5d authored by echicken's avatar echicken :chicken:
Browse files

Don't display files with blacklisted extensions inline.

parent bf0476f6
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -42,7 +42,12 @@ if ((http_request.method === 'GET' || http_request.method === 'POST') && ...@@ -42,7 +42,12 @@ if ((http_request.method === 'GET' || http_request.method === 'POST') &&
reply.error = 'Not enough credits to download this file'; reply.error = 'Not enough credits to download this file';
break; break;
} }
var mt = settings.files_inline ? getMimeType(file) : 'application/octet-stream'; var mt;
if (!settings.files_inline || settings.files_inline_blacklist.indexOf(file.ext) > -1) {
mt = 'application/octet-stream';
} else {
mt = getMimeType(file);
}
http_reply.header['Content-Type'] = mt; http_reply.header['Content-Type'] = mt;
if (mt === 'application/octet-stream') { if (mt === 'application/octet-stream') {
http_reply.header['Content-Disposition'] = 'attachment; filename="' + file.base + '.' + file.ext + '"'; http_reply.header['Content-Disposition'] = 'attachment; filename="' + file.base + '.' + file.ext + '"';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment