Skip to content

Commit

Permalink
Merge pull request #12099 from Tharanidk/skipUrl
Browse files Browse the repository at this point in the history
Skip URL validation for parameterized endpoints
  • Loading branch information
Tharanidk authored Jul 26, 2023
2 parents 1d47481 + 05bf603 commit c74a47e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9621,9 +9621,10 @@ public static boolean validateEndpointURLs(ArrayList<String> endpoints) {
UrlValidator urlValidator = new UrlValidator(authorityValidator, validatorOptions);

for (String endpoint : endpoints) {
// If url is a JMS connection url or a Consul service discovery related url, validation is skipped.
// If not, validity is checked.
if (!endpoint.startsWith("jms:") && !endpoint.startsWith("consul(") && !urlValidator.isValid(endpoint)) {
// If url is a JMS connection url or a Consul service discovery related url, or a parameterized URL
// validation is skipped. If not, validity is checked.
if (!endpoint.startsWith("jms:") && !endpoint.startsWith("consul(") && !endpoint.contains("{") &&
!endpoint.contains("}") && !urlValidator.isValid(endpoint)) {
try {
// If the url is not identified as valid from the above check,
// next step is determine the validity of the encoded url (done through the URI constructor).
Expand Down

0 comments on commit c74a47e

Please sign in to comment.