Skip to content

Commit

Permalink
fix empty path (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
itboy87 authored Aug 18, 2024
1 parent 922be60 commit 62e5e32
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal fun SocketHttpFetch(socketGen: suspend (Boolean) -> AsyncSocket = { Asy
socket.connect(host, port)
val buffered = BufferedAsyncInputStream(socket)

socket.write(computeHeader(method, path, host, headers).encodeToByteArray())
socket.write(computeHeader(method, if (path.isBlank()) "/" else path, host, headers).encodeToByteArray())
body?.copyTo(socket)

val firstLine = buffered.readLine()
Expand Down

0 comments on commit 62e5e32

Please sign in to comment.