Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownJoe796 committed Mar 8, 2024
2 parents 589a5e0 + c93f124 commit edd2c82
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ import io.ktor.client.plugins.websocket.*
import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*
import io.ktor.util.*
import io.ktor.utils.io.jvm.javaio.*
import io.ktor.websocket.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.ClosedReceiveChannelException
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.io.File


val client: HttpClient
Expand Down Expand Up @@ -72,8 +71,7 @@ actual suspend fun fetch(
) ?: "application/octet-stream"
contentType(ContentType.parse(type))
setBody(
AndroidAppContext.applicationCtx.contentResolver.openInputStream(body.content.uri)!!
.toByteReadChannel()
body.content.uri.path?.let { File(it).readBytes() }
)
}

Expand Down

0 comments on commit edd2c82

Please sign in to comment.