Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6d0045d2
Commit
6d0045d2
authored
Oct 24, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix rubocop violations
parent
0258a37f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
lib/gitlab/testing/request_inspector_middleware.rb
lib/gitlab/testing/request_inspector_middleware.rb
+9
-6
No files found.
lib/gitlab/testing/request_inspector_middleware.rb
View file @
6d0045d2
# rubocop:disable Style/ClassVars
module
Gitlab
module
Testing
class
RequestInspectorMiddleware
...
...
@@ -30,12 +32,13 @@ module Gitlab
request_headers
=
env_http_headers
(
env
)
status
,
headers
,
body
=
@app
.
call
(
env
)
log_response
(
OpenStruct
.
new
(
request
=
OpenStruct
.
new
(
url:
url
,
status_code:
status
,
request_headers:
request_headers
,
response_headers:
headers
))
)
log_request
request
[
status
,
headers
,
body
]
end
...
...
@@ -43,14 +46,14 @@ module Gitlab
private
def
env_http_headers
(
env
)
Hash
[
*
env
.
select
{
|
k
,
v
|
k
.
start_with?
'HTTP_'
}
.
collect
{
|
k
,
v
|
[
k
.
sub
(
/^HTTP_/
,
''
),
v
]}
.
collect
{
|
k
,
v
|
[
k
.
split
(
'_'
).
collect
(
&
:capitalize
).
join
(
'-'
),
v
]}
Hash
[
*
env
.
select
{
|
k
,
v
|
k
.
start_with?
'HTTP_'
}
.
collect
{
|
k
,
v
|
[
k
.
sub
(
/^HTTP_/
,
''
),
v
]}
.
collect
{
|
k
,
v
|
[
k
.
split
(
'_'
).
collect
(
&
:capitalize
).
join
(
'-'
),
v
]}
.
sort
.
flatten
]
end
def
log_re
sponse
(
response
)
def
log_re
quest
(
response
)
@@logged_requests
.
push
(
response
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment