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:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-11-23 19:44:09 +0300
committerNick Thomas <nick@gitlab.com>2018-11-23 19:44:09 +0300
commit9a5703ec82d394c2549f5afda7280c889d4cc373 (patch)
treea4a5b2fdaccf5743cff5871fe7b6bac47b42f6cf /app/controllers
parent63c1ad18b77e24af53e6c56fd45f8b2fa5994018 (diff)
Set content disposition attachment to several endpoints
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/profiles/keys_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb
index 3c3dc03a4ee..912421e3d08 100644
--- a/app/controllers/profiles/keys_controller.rb
+++ b/app/controllers/profiles/keys_controller.rb
@@ -40,7 +40,8 @@ class Profiles::KeysController < Profiles::ApplicationController
begin
user = UserFinder.new(params[:username]).find_by_username
if user.present?
- render text: user.all_ssh_keys.join("\n"), content_type: "text/plain"
+ headers['Content-Disposition'] = 'attachment'
+ render text: user.all_ssh_keys.join("\n"), content_type: 'text/plain'
else
return render_404
end