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)}")
|
||||
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)
|
||||
flags = result.flags
|
||||
} catch (_: Exception) {
|
||||
|
||||
@ -34,7 +34,7 @@ class BLKillSwitchClient(
|
||||
suspend fun check(): KillSwitchResult {
|
||||
return try {
|
||||
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)
|
||||
} catch (_: Exception) {
|
||||
KillSwitchResult.ok()
|
||||
|
||||
@ -187,7 +187,7 @@ class BLTelemetryClient(
|
||||
scope.launch {
|
||||
val body = json.encodeToString(EventBatch(batch))
|
||||
client.fireAndForget(
|
||||
"POST", "/telemetry/events", body,
|
||||
"POST", "/api/telemetry/events", body,
|
||||
extraHeaders = mapOf("X-Install-Token" to installId),
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user