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:
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb26
1 files changed, 2 insertions, 24 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 7c69f43fa3d..f60da46826a 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -3,7 +3,7 @@
require 'gon'
require 'fogbugz'
-class ApplicationController < ActionController::Base
+class ApplicationController < BaseActionController
include Gitlab::GonHelper
include Gitlab::NoCacheHeaders
include GitlabRoutingHelper
@@ -24,6 +24,7 @@ class ApplicationController < ActionController::Base
include ::Gitlab::EndpointAttributes
include FlocOptOut
include CheckRateLimit
+ include RequestPayloadLogger
extend ContentSecurityPolicyPatch
before_action :limit_session_time, if: -> { !current_user }
@@ -180,29 +181,6 @@ class ApplicationController < ActionController::Base
@workhorse_excluded_content_types ||= %w[text/html application/json]
end
- def append_info_to_payload(payload)
- super
-
- payload[:ua] = request.env["HTTP_USER_AGENT"]
- payload[:remote_ip] = request.remote_ip
-
- payload[Labkit::Correlation::CorrelationId::LOG_KEY] = Labkit::Correlation::CorrelationId.current_id
- payload[:metadata] = @current_context
- payload[:request_urgency] = urgency&.name
- payload[:target_duration_s] = urgency&.duration
- logged_user = auth_user
- if logged_user.present?
- payload[:user_id] = logged_user.try(:id)
- payload[:username] = logged_user.try(:username)
- end
-
- payload[:queue_duration_s] = request.env[::Gitlab::Middleware::RailsQueueDuration::GITLAB_RAILS_QUEUE_DURATION_KEY]
-
- payload[:response_bytes] = response.body_parts.sum(&:bytesize) if Feature.enabled?(:log_response_length)
-
- store_cloudflare_headers!(payload, request)
- end
-
##
# Controllers such as GitHttpController may use alternative methods
# (e.g. tokens) to authenticate the user, whereas Devise sets current_user.