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
Léo-Paul Géneau
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
Hide 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
Gitlab
module
Testing
module
Testing
class
RequestInspectorMiddleware
class
RequestInspectorMiddleware
...
@@ -30,12 +32,13 @@ module Gitlab
...
@@ -30,12 +32,13 @@ module Gitlab
request_headers
=
env_http_headers
(
env
)
request_headers
=
env_http_headers
(
env
)
status
,
headers
,
body
=
@app
.
call
(
env
)
status
,
headers
,
body
=
@app
.
call
(
env
)
log_response
(
OpenStruct
.
new
(
request
=
OpenStruct
.
new
(
url:
url
,
url:
url
,
status_code:
status
,
status_code:
status
,
request_headers:
request_headers
,
request_headers:
request_headers
,
response_headers:
headers
response_headers:
headers
))
)
log_request
request
[
status
,
headers
,
body
]
[
status
,
headers
,
body
]
end
end
...
@@ -43,14 +46,14 @@ module Gitlab
...
@@ -43,14 +46,14 @@ module Gitlab
private
private
def
env_http_headers
(
env
)
def
env_http_headers
(
env
)
Hash
[
*
env
.
select
{
|
k
,
v
|
k
.
start_with?
'HTTP_'
}
Hash
[
*
env
.
select
{
|
k
,
v
|
k
.
start_with?
'HTTP_'
}
.
collect
{
|
k
,
v
|
[
k
.
sub
(
/^HTTP_/
,
''
),
v
]}
.
collect
{
|
k
,
v
|
[
k
.
sub
(
/^HTTP_/
,
''
),
v
]}
.
collect
{
|
k
,
v
|
[
k
.
split
(
'_'
).
collect
(
&
:capitalize
).
join
(
'-'
),
v
]}
.
collect
{
|
k
,
v
|
[
k
.
split
(
'_'
).
collect
(
&
:capitalize
).
join
(
'-'
),
v
]}
.
sort
.
sort
.
flatten
]
.
flatten
]
end
end
def
log_re
sponse
(
response
)
def
log_re
quest
(
response
)
@@logged_requests
.
push
(
response
)
@@logged_requests
.
push
(
response
)
end
end
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