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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
71878c5d
Commit
71878c5d
authored
Nov 05, 2020
by
Philip Cunningham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cut redundant validate! call from DAST service
Provided already via Gitlab::HTTPConnectionAdapter.
parent
0e5b721e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ee/app/services/dast_site_validations/validate_service.rb
ee/app/services/dast_site_validations/validate_service.rb
+1
-2
ee/spec/services/dast_site_validations/validate_service_spec.rb
...c/services/dast_site_validations/validate_service_spec.rb
+4
-3
No files found.
ee/app/services/dast_site_validations/validate_service.rb
View file @
71878c5d
...
...
@@ -33,8 +33,7 @@ module DastSiteValidations
end
def
make_http_request!
uri
,
_
=
Gitlab
::
UrlBlocker
.
validate!
(
dast_site_validation
.
validation_url
)
Gitlab
::
HTTP
.
get
(
uri
)
Gitlab
::
HTTP
.
get
(
dast_site_validation
.
validation_url
)
end
def
token_found?
(
response
)
...
...
ee/spec/services/dast_site_validations/validate_service_spec.rb
View file @
71878c5d
...
...
@@ -40,11 +40,12 @@ RSpec.describe DastSiteValidations::ValidateService do
end
it
'validates the url before making an http request'
do
uri
=
double
(
'uri'
)
uri
=
URI
(
dast_site_validation
.
validation_url
)
opt
=
hash_including
(
allow_local_network:
false
,
allow_localhost:
false
,
dns_rebind_protection:
true
)
aggregate_failures
do
expect
(
Gitlab
::
UrlBlocker
).
to
receive
(
:validate!
).
and_return
([
uri
,
nil
])
expect
(
Gitlab
::
HTTP
).
to
receive
(
:get
).
with
(
uri
).
and_return
(
double
(
'response'
,
body:
token
))
expect
(
Gitlab
::
UrlBlocker
).
to
receive
(
:validate!
).
with
(
uri
,
opt
).
and_call_original
expect
(
Gitlab
::
HTTP
).
to
receive
(
:get
).
with
(
dast_site_validation
.
validation_url
).
and_call_original
end
subject
...
...
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