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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 17:22:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-20 17:22:11 +0300
commit0c872e02b2c822e3397515ec324051ff540f0cd5 (patch)
treece2fb6ce7030e4dad0f4118d21ab6453e5938cdd /app/controllers/application_controller.rb
parentf7e05a6853b12f02911494c4b3fe53d9540d74fc (diff)
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb20
1 files changed, 7 insertions, 13 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 4de6b5de42a..e64d3110c3a 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -158,7 +158,7 @@ class ApplicationController < ActionController::Base
protected
def workhorse_excluded_content_types
- @workhorse_excluded_content_types ||= %w(text/html application/json)
+ @workhorse_excluded_content_types ||= %w[text/html application/json]
end
def append_info_to_payload(payload)
@@ -179,9 +179,7 @@ class ApplicationController < ActionController::Base
payload[:queue_duration_s] = request.env[::Gitlab::Middleware::RailsQueueDuration::GITLAB_RAILS_QUEUE_DURATION_KEY]
- if Feature.enabled?(:log_response_length)
- payload[:response_bytes] = response.body_parts.sum(&:bytesize)
- end
+ payload[:response_bytes] = response.body_parts.sum(&:bytesize) if Feature.enabled?(:log_response_length)
store_cloudflare_headers!(payload, request)
end
@@ -349,9 +347,7 @@ class ApplicationController < ActionController::Base
def check_password_expiration
return if session[:impersonator_id] || !current_user&.allow_password_authentication?
- if current_user&.password_expired?
- redirect_to new_profile_password_path
- end
+ redirect_to new_profile_password_path if current_user&.password_expired?
end
def active_user_check
@@ -426,8 +422,8 @@ class ApplicationController < ActionController::Base
# accepting the terms.
redirect_path = if request.get?
request.fullpath
- else
- URI(request.referer).path if request.referer
+ elsif request.referer
+ URI(request.referer).path
end
flash[:notice] = message
@@ -529,7 +525,7 @@ class ApplicationController < ActionController::Base
end
def set_page_title_header
- # Per https://tools.ietf.org/html/rfc5987, headers need to be ISO-8859-1, not UTF-8
+ # Per https://www.rfc-editor.org/rfc/rfc5987, headers need to be ISO-8859-1, not UTF-8
response.headers['Page-Title'] = Addressable::URI.encode_component(page_title('GitLab'))
end
@@ -565,9 +561,7 @@ class ApplicationController < ActionController::Base
session[:ask_for_usage_stats_consent] = current_user.requires_usage_stats_consent?
- if session[:ask_for_usage_stats_consent]
- disable_usage_stats
- end
+ disable_usage_stats if session[:ask_for_usage_stats_consent]
end
def disable_usage_stats