File tree Expand file tree Collapse file tree 2 files changed +1
-16
lines changed
src/main/kotlin/com/coder/toolbox Expand file tree Collapse file tree 2 files changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import com.coder.toolbox.util.SemVer
77import com.coder.toolbox.util.getHeaders
88import com.coder.toolbox.util.getOS
99import com.coder.toolbox.util.sha1
10- import com.coder.toolbox.util.withLastSegment
1110import okhttp3.ResponseBody
1211import retrofit2.Response
1312import java.io.FileInputStream
@@ -154,7 +153,7 @@ class CoderDownloadService(
154153 }
155154
156155 private suspend fun downloadSignature (url : URL , showTextProgress : (String ) -> Unit ): DownloadResult {
157- val signatureURL = url.withLastSegment( context.settingsStore.defaultSignatureNameByOsAndArch)
156+ val signatureURL = url.toURI().resolve( context.settingsStore.defaultSignatureNameByOsAndArch).toURL( )
158157 val localSignaturePath = localBinaryPath.parent.resolve(context.settingsStore.defaultSignatureNameByOsAndArch)
159158 context.logger.info(" Downloading signature from $signatureURL " )
160159
Original file line number Diff line number Diff line change @@ -13,20 +13,6 @@ fun URL.withPath(path: String): URL = URL(
1313 if (path.startsWith(" /" )) path else " /$path " ,
1414)
1515
16- fun URL.withLastSegment (segment : String ): URL {
17- val uri = this .toURI()
18- val basePath = uri.path.substringBeforeLast(' /' )
19- val newPath = " $basePath /$segment "
20- val newUri = URI (
21- uri.scheme,
22- uri.authority,
23- newPath,
24- uri.query,
25- uri.fragment
26- )
27- return newUri.toURL()
28- }
29-
3016/* *
3117 * Return the host, converting IDN to ASCII in case the file system cannot
3218 * support the necessary character set.
You can’t perform that action at this time.
0 commit comments