Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-05-02 18:25:26 +0300
committerSean McGivern <sean@mcgivern.me.uk>2017-05-02 18:25:26 +0300
commitc5dee301f8bb6496c09c2aef54f9665b350c535f (patch)
treeae6354684944ff91413a5c2cceb9126014aff893 /app/controllers/concerns
parentd32ecb23eb10065b1cc5eea95f4271ef402f0059 (diff)
parent0ca6ff67e438a8218ac53edd6280041d2f4b7a9c (diff)
Merge branch 'dm-snippet-download-button' into 'master'
Add download button to project snippets See merge request !11004
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r--app/controllers/concerns/snippets_actions.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/concerns/snippets_actions.rb b/app/controllers/concerns/snippets_actions.rb
index ca6dffe1cc5..ffea712a833 100644
--- a/app/controllers/concerns/snippets_actions.rb
+++ b/app/controllers/concerns/snippets_actions.rb
@@ -5,10 +5,12 @@ module SnippetsActions
end
def raw
+ disposition = params[:inline] == 'false' ? 'attachment' : 'inline'
+
send_data(
convert_line_endings(@snippet.content),
type: 'text/plain; charset=utf-8',
- disposition: 'inline',
+ disposition: disposition,
filename: @snippet.sanitized_file_name
)
end