Skip to content

Commit

Permalink
Fixed getPluginLicense error
Browse files Browse the repository at this point in the history
  • Loading branch information
osakila authored Nov 26, 2024
1 parent 480f9c6 commit 3661c8d
Showing 1 changed file with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,9 @@ class ThetaRepository internal constructor(val endpoint: String, config: Config?
throw ThetaWebApiException(response.toString())
}
val input = response.body<ByteReadPacket>()
val builder = StringBuilder()
try {
while (!input.endOfInput) {
val char = input.readText(1, 1)
builder.append(char)
}
} catch (e: Throwable) {
throw e
} finally {
input.close()
}
return builder.toString()
val bytes = input.readBytes()
// decodeToString replaces invalid byte sequence with \uFFFD
return bytes.decodeToString()
} catch (e: JsonConvertException) {
throw ThetaWebApiException(e.message ?: e.toString())
} catch (e: ResponseException) {
Expand Down Expand Up @@ -7789,7 +7780,10 @@ class ThetaRepository internal constructor(val endpoint: String, config: Config?
if (response.status != HttpStatusCode.OK) {
throw ThetaWebApiException(response.toString())
}
return response.bodyAsText()
val input = response.body<ByteReadPacket>()
val bytes = input.readBytes()
// decodeToString replaces invalid byte sequence with \uFFFD
return bytes.decodeToString()
} catch (e: JsonConvertException) {
throw ThetaWebApiException(e.message ?: e.toString())
} catch (e: ResponseException) {
Expand Down

0 comments on commit 3661c8d

Please sign in to comment.