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
a6ae7344
Commit
a6ae7344
authored
Apr 06, 2021
by
Philip Cunningham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert empty DAST excluded_urls to nil
- Convert excluded_urls to nil when array is empty - Add spec
parent
78ee268e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
ee/app/services/dast_on_demand_scans/params_create_service.rb
...pp/services/dast_on_demand_scans/params_create_service.rb
+1
-1
ee/spec/services/dast_on_demand_scans/params_create_service_spec.rb
...rvices/dast_on_demand_scans/params_create_service_spec.rb
+8
-0
No files found.
ee/app/services/dast_on_demand_scans/params_create_service.rb
View file @
a6ae7344
...
...
@@ -73,7 +73,7 @@ module DastOnDemandScans
return
{}
unless
dast_site_profile
{
excluded_urls:
dast_site_profile
.
excluded_urls
.
join
(
','
),
excluded_urls:
dast_site_profile
.
excluded_urls
.
presence
&
.
join
(
','
),
auth_username_field:
dast_site_profile
.
auth_username_field
,
auth_password_field:
dast_site_profile
.
auth_password_field
,
auth_username:
dast_site_profile
.
auth_username
...
...
ee/spec/services/dast_on_demand_scans/params_create_service_spec.rb
View file @
a6ae7344
...
...
@@ -70,6 +70,14 @@ RSpec.describe DastOnDemandScans::ParamsCreateService do
)
end
context
'when dast_site_profile.excluded_urls is empty'
do
let_it_be
(
:dast_site_profile
)
{
create
(
:dast_site_profile
,
project:
project
,
excluded_urls:
[])
}
it
'returns nil'
do
expect
(
subject
.
payload
[
:excluded_urls
]).
to
be_nil
end
end
context
'when the target is not validated and an active scan is requested'
do
let_it_be
(
:active_dast_scanner_profile
)
{
create
(
:dast_scanner_profile
,
project:
project
,
scan_type:
'active'
)
}
...
...
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