diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /lib/gitlab/testing/request_inspector_middleware.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'lib/gitlab/testing/request_inspector_middleware.rb')
-rw-r--r-- | lib/gitlab/testing/request_inspector_middleware.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/testing/request_inspector_middleware.rb b/lib/gitlab/testing/request_inspector_middleware.rb index 36cdfebcc28..3cbe97cd84c 100644 --- a/lib/gitlab/testing/request_inspector_middleware.rb +++ b/lib/gitlab/testing/request_inspector_middleware.rb @@ -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, |