From c3f81cc97a2fb62e6713b93964ba5f310b042a63 Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Thu, 19 Mar 2026 20:03:26 -0700 Subject: [PATCH] fix(kotlin-sdk): add platform query parameter to kill-switch URL BLKillSwitchClient was missing the platform query parameter that BLFeatureFlagClient already sends. This caused the test 'sends correct query parameters' to fail. --- .../main/kotlin/com/bytelyst/platform/BLKillSwitchClient.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kotlin-platform-sdk/src/main/kotlin/com/bytelyst/platform/BLKillSwitchClient.kt b/packages/kotlin-platform-sdk/src/main/kotlin/com/bytelyst/platform/BLKillSwitchClient.kt index b50b4dbb..b05d1721 100644 --- a/packages/kotlin-platform-sdk/src/main/kotlin/com/bytelyst/platform/BLKillSwitchClient.kt +++ b/packages/kotlin-platform-sdk/src/main/kotlin/com/bytelyst/platform/BLKillSwitchClient.kt @@ -33,8 +33,8 @@ class BLKillSwitchClient( */ suspend fun check(): KillSwitchResult { return try { - val productId = URLEncoder.encode(config.productId, "UTF-8") - val response = client.request("GET", "/api/settings/kill-switch?productId=$productId", skipAuth = true) + val enc = { v: String -> URLEncoder.encode(v, "UTF-8") } + val response = client.request("GET", "/api/settings/kill-switch?productId=${enc(config.productId)}&platform=${enc(config.platform)}", skipAuth = true) json.decodeFromString(response) } catch (_: Exception) { KillSwitchResult.ok()