Skip to content

Commit

Permalink
Merge pull request #1799 from SuperKael/release-upload-fix
Browse files Browse the repository at this point in the history
Only try to strip upload url 'helpful garbage' if it is present
  • Loading branch information
bitwiseman authored Feb 23, 2024
2 parents baf5c3b + a1499d7 commit 6f3f39f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/kohsuke/github/GHRelease.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ public GHAsset uploadAsset(String filename, InputStream stream, String contentTy
Requester builder = owner.root().createRequest().method("POST");
String url = getUploadUrl();
// strip the helpful garbage from the url
url = url.substring(0, url.indexOf('{'));
int endIndex = url.indexOf('{');
if (endIndex != -1) {
url = url.substring(0, endIndex);
}
url += "?name=" + URLEncoder.encode(filename, "UTF-8");
return builder.contentType(contentType).with(stream).withUrlPath(url).fetch(GHAsset.class).wrap(this);
}
Expand Down

0 comments on commit 6f3f39f

Please sign in to comment.