Skip to content

Commit

Permalink
Fix NumberFormatException in UNIX socket path to hex string (#131)
Browse files Browse the repository at this point in the history
Fix NumberFormatException in socket path to hex
  • Loading branch information
DevNatan authored Feb 4, 2024
1 parent 21dbd0e commit f4a811c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/me/devnatan/yoki/io/Http.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private fun createUrlBuilder(socketPath: String): URLBuilder = if (isUnixSocket(
URLBuilder(
protocol = URLProtocol.HTTP,
port = DOCKER_SOCKET_PORT,
host = socketPath.substringAfter(UNIX_SOCKET_PREFIX).toInt().toHexString() + ENCODED_HOSTNAME_SUFFIX,
host = socketPath.substringAfter(UNIX_SOCKET_PREFIX).encodeToByteArray().toHexString() + ENCODED_HOSTNAME_SUFFIX,
)
} else {
val url = Url(socketPath)
Expand Down

0 comments on commit f4a811c

Please sign in to comment.