Commit f4ce0ddd authored by Douwe Maan's avatar Douwe Maan

Show image attachments in browser instead of downloading them.

Resolves #1702.
parent 56a456b4
......@@ -5,7 +5,8 @@ class FilesController < ApplicationController
if uploader.file_storage?
if can?(current_user, :read_project, note.project)
send_file uploader.file.path, disposition: 'attachment'
disposition = uploader.image? ? 'inline' : 'attachment'
send_file uploader.file.path, disposition: disposition
else
not_found!
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment