1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

GithubApi: fix the name of the asset.

This commit is contained in:
Cedric Beust 2015-11-13 23:27:29 -08:00
parent bc0eac0d0a
commit 8dfcb7c56a

View file

@ -73,7 +73,8 @@ public class GithubApi @Inject constructor(val executors: KobaltExecutors,
private fun uploadAsset(token: String, uploadUrl: String, typedFile: TypedFile, tagName: String) private fun uploadAsset(token: String, uploadUrl: String, typedFile: TypedFile, tagName: String)
: Observable<UploadAssetResponse> { : Observable<UploadAssetResponse> {
val strippedUrl = uploadUrl.substring(0, uploadUrl.indexOf("{")) val strippedUrl = uploadUrl.substring(0, uploadUrl.indexOf("{"))
val url = "$strippedUrl?name=$tagName&label=$tagName" val fileName = typedFile.file().name
val url = "$strippedUrl?name=$fileName&label=$fileName"
val headers = Headers.of("Authorization", "token $token") val headers = Headers.of("Authorization", "token $token")
val totalSize = typedFile.file().length() val totalSize = typedFile.file().length()
http.uploadFile(url = url, file = typedFile, headers = headers, http.uploadFile(url = url, file = typedFile, headers = headers,