fix(kotlin-sdk): add missing /api prefix to flags, kill-switch, and telemetry routes
This commit is contained in:
parent
78b942a105
commit
053190d660
@ -82,7 +82,7 @@ class BLFeatureFlagClient(
|
|||||||
append("?platform=${enc(config.platform)}")
|
append("?platform=${enc(config.platform)}")
|
||||||
userId?.let { append("&userId=${enc(it)}") }
|
userId?.let { append("&userId=${enc(it)}") }
|
||||||
}
|
}
|
||||||
val response = client.request("GET", "/flags/poll$qs", skipAuth = true)
|
val response = client.request("GET", "/api/flags/poll$qs", skipAuth = true)
|
||||||
val result = json.decodeFromString<FlagResponse>(response)
|
val result = json.decodeFromString<FlagResponse>(response)
|
||||||
flags = result.flags
|
flags = result.flags
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class BLKillSwitchClient(
|
|||||||
suspend fun check(): KillSwitchResult {
|
suspend fun check(): KillSwitchResult {
|
||||||
return try {
|
return try {
|
||||||
val platform = URLEncoder.encode(config.platform, "UTF-8")
|
val platform = URLEncoder.encode(config.platform, "UTF-8")
|
||||||
val response = client.request("GET", "/flags/kill-switch?platform=$platform", skipAuth = true)
|
val response = client.request("GET", "/api/flags/kill-switch?platform=$platform", skipAuth = true)
|
||||||
json.decodeFromString<KillSwitchResult>(response)
|
json.decodeFromString<KillSwitchResult>(response)
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
KillSwitchResult.ok()
|
KillSwitchResult.ok()
|
||||||
|
|||||||
@ -187,7 +187,7 @@ class BLTelemetryClient(
|
|||||||
scope.launch {
|
scope.launch {
|
||||||
val body = json.encodeToString(EventBatch(batch))
|
val body = json.encodeToString(EventBatch(batch))
|
||||||
client.fireAndForget(
|
client.fireAndForget(
|
||||||
"POST", "/telemetry/events", body,
|
"POST", "/api/telemetry/events", body,
|
||||||
extraHeaders = mapOf("X-Install-Token" to installId),
|
extraHeaders = mapOf("X-Install-Token" to installId),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user