Commit 18c49fe8 authored by Francisco Javier López's avatar Francisco Javier López

Merge branch 'rubocop-performance-openstruct-snippets_finder-325744' into 'master'

Fix the offences introduced by Performance/OpenStruct

See merge request gitlab-org/gitlab!70900
parents 647faac7 4b9efcaf
......@@ -2211,7 +2211,6 @@ Performance/OpenStruct:
- 'lib/gitlab/ci/ansi2html.rb'
- 'lib/gitlab/git/diff_collection.rb'
- 'lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb'
- 'lib/gitlab/testing/request_inspector_middleware.rb'
- 'lib/mattermost/session.rb'
# WIP: https://gitlab.com/gitlab-org/gitlab/-/issues/324629
......
......@@ -9,6 +9,8 @@ module Gitlab
@@logged_requests = Concurrent::Array.new
@@inject_headers = Concurrent::Hash.new
Request = Struct.new(:url, :status_code, :request_headers, :response_headers, :body, keyword_init: true)
# Resets the current request log and starts logging requests
def self.log_requests!(headers = {})
@@inject_headers.replace(headers)
......@@ -40,7 +42,7 @@ module Gitlab
full_body = +''
body.each { |b| full_body << b }
request = OpenStruct.new(
request = Request.new(
url: url,
status_code: status,
request_headers: request_headers,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment