Skip to content

Commit b851b6d

Browse files
authored
🐛 Disable gzip encoding to restore expected decryption behavior (#3242)
1 parent a5ef3b6 commit b851b6d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

app/src/commonMain/kotlin/com/crosspaste/net/PasteClient.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class PasteClient(
2626

2727
private val client: HttpClient =
2828
HttpClient(CIO) {
29+
install(DefaultRequest) {
30+
header(HttpHeaders.AcceptEncoding, "identity")
31+
}
2932
install(HttpTimeout) {
3033
requestTimeoutMillis = 1000
3134
}

app/src/commonMain/kotlin/com/crosspaste/net/clientapi/PullClientApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PullClientApi(
6565
): ClientApiResult =
6666
if (response.status.value == 200) {
6767
logger.debug { "Success to pull $api" }
68-
SuccessResult(response.rawContent)
68+
SuccessResult(response.bodyAsChannel())
6969
} else {
7070
val failResponse = response.body<FailResponse>()
7171
createFailureResult(

app/src/commonMain/kotlin/com/crosspaste/net/plugin/ClientDecryptPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ClientDecryptPlugin(
3838
return@intercept
3939
}
4040
logger.debug { "client decrypt $appInstanceId" }
41-
val byteReadChannel: ByteReadChannel = it.rawContent
41+
val byteReadChannel: ByteReadChannel = it.bodyAsChannel()
4242

4343
val contentType = it.call.response.contentType()
4444

0 commit comments

Comments
 (0)