Commit 09580cb6 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch...

Merge branch 'philipcunningham-fix-issue-with-excluded-urls-in-on-demand-dast-scans-326889' into 'master'

Convert empty DAST excluded_urls to nil

See merge request gitlab-org/gitlab!58611
parents 8753c663 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
......
......@@ -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') }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment