summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-05-06 10:33:52 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-05-06 10:33:52 +0000
commitd7eb886b9fd32ad2d0ab7bca9128dbb40e80c0da (patch)
treecb08813cb677cbd292d036bf18e2acfbbcd1be16 /app/controllers
parent3f30ab5733843d1279d283ae98ab89b646f8f25d (diff)
parent5faa98f481e0f5e0ccb1758c34a104f523ab21d2 (diff)
downloadgitlab-ce-d7eb886b9fd32ad2d0ab7bca9128dbb40e80c0da.tar.gz
Merge branch 'jej/session-stored-globaly' into 'master'
Session stored globally per request See merge request gitlab-org/gitlab-ce!27658
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/application_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index ceaa84acaba..4cbab6811bc 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -27,6 +27,7 @@ class ApplicationController < ActionController::Base
before_action :check_impersonation_availability
around_action :set_locale
+ around_action :set_session_storage
after_action :set_page_title_header, if: :json_request?
after_action :limit_unauthenticated_session_times
@@ -434,6 +435,10 @@ class ApplicationController < ActionController::Base
Gitlab::I18n.with_user_locale(current_user, &block)
end
+ def set_session_storage(&block)
+ Gitlab::Session.with_session(session, &block)
+ end
+
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'] = URI.escape(page_title('GitLab'))