Commit ebdb3c04 authored by mc_rocha's avatar mc_rocha

Handle invalid URL for DAST Site Profile

This Merge Request fix the validation for dast site profile url

Changelog: changed
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80170
parent 5407670f
......@@ -12,7 +12,7 @@ module AppSec
return success_response(existing_validation.dast_site_token, existing_validation.state) if existing_validation
find_or_create_dast_site_token
rescue URI::InvalidURIError
rescue Addressable::URI::InvalidURIError
error_response('Invalid target_url')
end
......
......@@ -59,7 +59,7 @@ RSpec.describe AppSec::Dast::SiteTokens::FindOrCreateService do
let_it_be(:target_url) { 'http://bogus:broken' }
it 'communicates failure' do
expect(subject).to have_attributes(status: :error, message: ['Url is blocked: URI is invalid'])
expect(subject).to have_attributes(status: :error, message: 'Invalid target_url')
end
it 'does not create a dast_site_validation' do
......
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