summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
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