summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitry Medvinsky <me@dmedvinsky.name>2014-03-19 17:32:38 +0400
committerDmitry Medvinsky <me@dmedvinsky.name>2014-03-20 19:09:14 +0400
commitfefab474569f231676a4fd1579a70723d729f206 (patch)
tree0ab647700df2999e609e6e3195dd91ad79ec2caa /app
parentc0090a3ff50802d796ec36f49ade1bb4fdd4d190 (diff)
downloadgitlab-ce-fefab474569f231676a4fd1579a70723d729f206.tar.gz
Fix `/:username.keys` response content type
Currently this method responds with `text/html`. It is kind of unusable if you open it in a browser. The browser thinks it is HTML and renders it as HTML, meaning new lines are dropped. So it's very hard to distinguish where the key starts and where it ends. This commit changes the content type header to `text/plain`.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/profiles/keys_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb
index b4f14e649e2..6713cd7c8c7 100644
--- a/app/controllers/profiles/keys_controller.rb
+++ b/app/controllers/profiles/keys_controller.rb
@@ -41,7 +41,7 @@ class Profiles::KeysController < ApplicationController
begin
user = User.find_by_username(params[:username])
if user.present?
- render text: user.all_ssh_keys.join("\n")
+ render text: user.all_ssh_keys.join("\n"), content_type: "text/plain"
else
render_404 and return
end