Skip to content

Commit

Permalink
Added validation of the URL parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Oct 3, 2024
1 parent b97e443 commit e0d5a7f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/entry/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func Entry(octolintConfig *config.OctolintConfig) ([]checks.OctopusCheckResult,
return nil, errors.New("You must specify the URL with the -url argument")
}

if _, err := url.ParseRequestURI(octolintConfig.Url); err != nil {
return nil, errors.New("The URL \"" + octolintConfig.Url + "\"is not valid")
}

if octolintConfig.ApiKey == "" {
return nil, errors.New("You must specify the API key with the -apiKey argument")
}
Expand Down

0 comments on commit e0d5a7f

Please sign in to comment.