Skip to content

Commit c36d7e6

Browse files
committed
Add ContentNegotiation plugin to TopggStatsSender HttpClient
1 parent d51ac80 commit c36d7e6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

foxy/src/main/kotlin/net/cakeyfox/foxy/utils/analytics/TopggStatsSender.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package net.cakeyfox.foxy.utils.analytics
22

33
import io.ktor.client.*
4+
import io.ktor.client.plugins.contentnegotiation.*
45
import io.ktor.client.request.*
56
import io.ktor.client.statement.*
67
import io.ktor.http.*
8+
import io.ktor.serialization.kotlinx.json.*
79
import kotlinx.coroutines.*
810
import kotlinx.serialization.json.Json
911
import kotlinx.serialization.json.buildJsonObject
@@ -41,7 +43,9 @@ class TopggStatsSender(
4143
}
4244

4345
private suspend fun getServerCountsFromClusters(): Int {
44-
val client = HttpClient()
46+
val client = HttpClient {
47+
install(ContentNegotiation) { json() }
48+
}
4549
val clusterUrls = foxy.config.discord.clusters
4650
.mapNotNull { if (!it.canPublishStats) it.clusterUrl else null }
4751

0 commit comments

Comments
 (0)