Read about our upcoming Code of Conduct on this issue

Commit f4ce0ddd authored by Douwe Maan's avatar Douwe Maan
Browse files

Show image attachments in browser instead of downloading them.

Resolves #1702.
parent 01de1651713a
......@@ -5,7 +5,8 @@ def download
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