Commit 4b9efcaf authored by Siddharth Asthana's avatar Siddharth Asthana

Fix the offences introduced by Performance/OpenStruct

Changelog: other
parent 8e24a20c
...@@ -2211,7 +2211,6 @@ Performance/OpenStruct: ...@@ -2211,7 +2211,6 @@ Performance/OpenStruct:
- 'lib/gitlab/ci/ansi2html.rb' - 'lib/gitlab/ci/ansi2html.rb'
- 'lib/gitlab/git/diff_collection.rb' - 'lib/gitlab/git/diff_collection.rb'
- 'lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb' - 'lib/gitlab/import_export/after_export_strategies/base_after_export_strategy.rb'
- 'lib/gitlab/testing/request_inspector_middleware.rb'
- 'lib/mattermost/session.rb' - 'lib/mattermost/session.rb'
# WIP: https://gitlab.com/gitlab-org/gitlab/-/issues/324629 # WIP: https://gitlab.com/gitlab-org/gitlab/-/issues/324629
......
...@@ -9,6 +9,8 @@ module Gitlab ...@@ -9,6 +9,8 @@ module Gitlab
@@logged_requests = Concurrent::Array.new @@logged_requests = Concurrent::Array.new
@@inject_headers = Concurrent::Hash.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 # Resets the current request log and starts logging requests
def self.log_requests!(headers = {}) def self.log_requests!(headers = {})
@@inject_headers.replace(headers) @@inject_headers.replace(headers)
...@@ -40,7 +42,7 @@ module Gitlab ...@@ -40,7 +42,7 @@ module Gitlab
full_body = +'' full_body = +''
body.each { |b| full_body << b } body.each { |b| full_body << b }
request = OpenStruct.new( request = Request.new(
url: url, url: url,
status_code: status, status_code: status,
request_headers: request_headers, 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