Skip to content

Commit 51cf42f

Browse files
committed
Improve handling of trailing slash in registry url
Signed-off-by: Tom Sellman <[email protected]>
1 parent 11086e9 commit 51cf42f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = 'io.nextflow'
9-
version = '0.0.1-alpha3'
9+
version = '0.0.1-alpha4'
1010

1111
repositories {
1212
mavenCentral()

src/main/groovy/io/nextflow/gradle/registry/RegistryClient.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ class RegistryClient {
1414
private final String authToken
1515

1616
RegistryClient(URI url, String authToken) {
17-
this.url = url
17+
this.url = !url.toString().endsWith("/")
18+
? URI.create(url.toString() + "/")
19+
: url
1820
this.authToken = authToken
1921
}
2022

2123
def publish(String id, String version, File file) {
22-
def req = new HttpPost(url.resolve("/publish"))
24+
def req = new HttpPost(url.resolve("publish"))
2325
req.addHeader("Authorization", "Bearer ${authToken}")
2426
req.setEntity(MultipartEntityBuilder.create()
2527
.addTextBody("id", id)

0 commit comments

Comments
 (0)