diff --git a/src/uk/org/floop/jenkins_pmd/Drafter.groovy b/src/uk/org/floop/jenkins_pmd/Drafter.groovy index f2f2420..f6f96dc 100644 --- a/src/uk/org/floop/jenkins_pmd/Drafter.groovy +++ b/src/uk/org/floop/jenkins_pmd/Drafter.groovy @@ -26,8 +26,7 @@ Drafter(PMD pmd, String user, String pass) { this.pmd = pmd this.apiBase = new URI(pmd.config.pmd_api) - this.host = new HttpHost(apiBase.getHost(), (apiBase.getPort() != -1) ? apiBase.getPort() : - apiBase.getScheme() == "http" ? 80 : 443) + this.host = new HttpHost(apiBase.getHost(), apiBase.getPort(), apiBase.getScheme()) this.user = user this.pass = pass } diff --git a/src/uk/org/floop/jenkins_pmd/Pipelines.groovy b/src/uk/org/floop/jenkins_pmd/Pipelines.groovy index 67f13ae..1adc84e 100644 --- a/src/uk/org/floop/jenkins_pmd/Pipelines.groovy +++ b/src/uk/org/floop/jenkins_pmd/Pipelines.groovy @@ -20,8 +20,7 @@ Pipelines(PMD pmd, String user, String pass) { this.pmd = pmd this.apiBase = new URI(pmd.config.pipeline_api) - this.host = new HttpHost(apiBase.getHost(), (apiBase.getPort() != -1) ? apiBase.getPort() : - apiBase.getScheme() == "http" ? 80 : 443) + this.host = new HttpHost(apiBase.getHost(), apiBase.getPort(), apiBase.getScheme()) this.user = user this.pass = pass this.basicAuth = "${user}:${pass}".bytes.encodeBase64()