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:
authorJarka Kadlecova <jarka@gitlab.com>2017-02-06 18:04:00 +0300
committerJarka Kadlecova <jarka@gitlab.com>2017-02-20 09:24:03 +0300
commitc9d687d6fed8ee9d0b9dfd1ebb55ddbb30b39fe2 (patch)
tree9ae2c095936d3c128401e72fc52d0d583aa3b1dc /app/controllers/snippets_controller.rb
parentb88e82ff0a1bca9687b5579208ba05a99e41a464 (diff)
Download snippets with LF line-endings by default
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r--app/controllers/snippets_controller.rb15
1 files changed, 2 insertions, 13 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb
index b169d993688..366804ab17e 100644
--- a/app/controllers/snippets_controller.rb
+++ b/app/controllers/snippets_controller.rb
@@ -1,6 +1,7 @@
class SnippetsController < ApplicationController
include ToggleAwardEmoji
include SpammableActions
+ include SnippetsActions
before_action :snippet, only: [:show, :edit, :destroy, :update, :raw, :download]
@@ -47,9 +48,6 @@ class SnippetsController < ApplicationController
respond_with @snippet.becomes(Snippet)
end
- def edit
- end
-
def update
UpdateSnippetService.new(nil, current_user, @snippet,
snippet_params).execute
@@ -67,18 +65,9 @@ class SnippetsController < ApplicationController
redirect_to snippets_path
end
- def raw
- send_data(
- @snippet.content,
- type: 'text/plain; charset=utf-8',
- disposition: 'inline',
- filename: @snippet.sanitized_file_name
- )
- end
-
def download
send_data(
- @snippet.content,
+ convert_line_endings(@snippet.content),
type: 'text/plain; charset=utf-8',
filename: @snippet.sanitized_file_name
)