From 0c322da7c6fde271bef8749d2054ba58c1aa5e2d Mon Sep 17 00:00:00 2001 From: eyalbe4 <00Rotshild00> Date: Sat, 9 Jul 2016 17:16:29 +0300 Subject: [PATCH] "override" attribute does not overrides files, instead appends "?override=1" to name of uploaded files. #133 --- .../com/jfrog/bintray/gradle/BintrayUploadTask.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy b/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy index fad4a9c..6f1928e 100644 --- a/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy +++ b/src/main/groovy/com/jfrog/bintray/gradle/BintrayUploadTask.groovy @@ -349,9 +349,6 @@ class BintrayUploadTask extends DefaultTask { def uploadArtifact = { artifact -> def versionPath = packagePath + '/' + versionName ?: artifact.version def uploadUri = "/content/$versionPath/${artifact.path}" - if (override) { - uploadUri += "?override=1" - } if (!artifact.file.exists()) { logger.error("Skipping upload for missing file '$artifact.file'.") @@ -367,6 +364,9 @@ class BintrayUploadTask extends DefaultTask { return } http.request(PUT) { + if (override) { + uri.query = [override: "1"] + } addHeaders(headers) // Set the requestContentType to BINARY, so that HTTPBuilder can encode the uploaded file: requestContentType = BINARY