diff --git a/src/main/java/io/jenkins/plugins/emmenthal/SsrfBuilder.java b/src/main/java/io/jenkins/plugins/emmenthal/SsrfBuilder.java index 885ac13..5a71850 100644 --- a/src/main/java/io/jenkins/plugins/emmenthal/SsrfBuilder.java +++ b/src/main/java/io/jenkins/plugins/emmenthal/SsrfBuilder.java @@ -82,6 +82,7 @@ public FormValidation doCheckUrl(@QueryParameter String value) throws IOExceptio Jenkins.get().checkPermission(Job.CONFIGURE); value = Util.fixEmptyAndTrim(value); + assert value != null; URL url = new URL(value); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("GET"); diff --git a/src/main/java/io/jenkins/plugins/emmenthal/SsrfWithCredsBuilder.java b/src/main/java/io/jenkins/plugins/emmenthal/SsrfWithCredsBuilder.java index cfbb32d..5cb6a28 100644 --- a/src/main/java/io/jenkins/plugins/emmenthal/SsrfWithCredsBuilder.java +++ b/src/main/java/io/jenkins/plugins/emmenthal/SsrfWithCredsBuilder.java @@ -121,7 +121,8 @@ public FormValidation doValidateUrlAndCredentialsId(@AncestorInPath Item item, @ CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class, item, ACL.SYSTEM, Collections.emptyList()), CredentialsMatchers.withId(credentialsId)); - + + assert url != null; URL urlObject = new URL(url); HttpURLConnection con = (HttpURLConnection) urlObject.openConnection(); con.setRequestMethod("GET"); diff --git a/src/main/java/io/jenkins/plugins/emmenthal/SsrfWithPasswordBuilder.java b/src/main/java/io/jenkins/plugins/emmenthal/SsrfWithPasswordBuilder.java index 370a8d7..56fefa4 100644 --- a/src/main/java/io/jenkins/plugins/emmenthal/SsrfWithPasswordBuilder.java +++ b/src/main/java/io/jenkins/plugins/emmenthal/SsrfWithPasswordBuilder.java @@ -108,6 +108,7 @@ public FormValidation doValidateUrlAndAuth(@QueryParameter String url, Jenkins.get().checkPermission(Job.CONFIGURE); url = Util.fixEmptyAndTrim(url); + assert url != null; URL urlObject = new URL(url); HttpURLConnection con = (HttpURLConnection) urlObject.openConnection(); con.setRequestMethod("GET");