summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-05 09:54:38 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-05 09:54:38 -0800
commit0a9cab4ee65f2b42c56989698c401cab60d68b53 (patch)
tree270726102d04571e7a45941dc4c7554b30817136
parent50e8e5943f182c65be1ef7777d06869029886d8e (diff)
parent8efed8b356606f688c05a1ce423e9001c4aa73b3 (diff)
downloadgitlab-ce-0a9cab4ee65f2b42c56989698c401cab60d68b53.tar.gz
Merge branch 'dont-download-image-attachments'
Conflicts: CHANGELOG
-rw-r--r--CHANGELOG2
-rw-r--r--app/controllers/files_controller.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 12d6f5830bf..235a99b4327 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,7 +9,7 @@ v 7.8.0
- Cleaner UI for web editor
- Add diff syntax highlighting in email-on-push service notifications (Hannes Rosenögger)
- Add API endpoint to fetch all changes on a MergeRequest (Jeroen van Baarsen)
- -
+ - View note image attachments in new tab when clicked instead of downloading them
-
- Allow more variations for commit messages closing issues (Julien Bianchi and Hannes Rosenögger)
-
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 7937454810d..9671245d3f4 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -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