summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-10-20 16:44:29 +0000
committerWinnie Hellmann <winnie@gitlab.com>2017-10-20 16:44:29 +0000
commitd8d7faf68cd419cedbacd61ffa2d7ce23847e089 (patch)
tree6a5afba6e886b972e824b41dafaa6d9f61fa1dab /app
parentf3117e795d175eeaf8c689cd3065a844ee49ab0e (diff)
downloadgitlab-ce-d8d7faf68cd419cedbacd61ffa2d7ce23847e089.tar.gz
URI decode Page-Title header to preserve UTF-8 characters
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/repo/helpers/repo_helper.js2
-rw-r--r--app/controllers/application_controller.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/repo/helpers/repo_helper.js b/app/assets/javascripts/repo/helpers/repo_helper.js
index dfaf9caaee7..19425cedc90 100644
--- a/app/assets/javascripts/repo/helpers/repo_helper.js
+++ b/app/assets/javascripts/repo/helpers/repo_helper.js
@@ -95,7 +95,7 @@ const RepoHelper = {
return Service.getContent()
.then((response) => {
const data = response.data;
- if (response.headers && response.headers['page-title']) data.pageTitle = response.headers['page-title'];
+ if (response.headers && response.headers['page-title']) data.pageTitle = decodeURI(response.headers['page-title']);
if (response.headers && response.headers['is-root'] && !Store.isInitialRoot) {
Store.isRoot = convertPermissionToBoolean(response.headers['is-root']);
Store.isInitialRoot = Store.isRoot;
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 967fe39256a..391a0519195 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -349,6 +349,6 @@ class ApplicationController < ActionController::Base
def set_page_title_header
# Per https://tools.ietf.org/html/rfc5987, headers need to be ISO-8859-1, not UTF-8
- response.headers['Page-Title'] = page_title('GitLab').encode('ISO-8859-1')
+ response.headers['Page-Title'] = URI.escape(page_title('GitLab'))
end
end