diff --git a/packages/swift-platform-sdk/Sources/BLKillSwitchClient.swift b/packages/swift-platform-sdk/Sources/BLKillSwitchClient.swift index 964c434f..736965d3 100644 --- a/packages/swift-platform-sdk/Sources/BLKillSwitchClient.swift +++ b/packages/swift-platform-sdk/Sources/BLKillSwitchClient.swift @@ -27,6 +27,8 @@ public final class BLKillSwitchClient { var request = URLRequest(url: url) request.timeoutInterval = 5 + request.setValue(config.productId, forHTTPHeaderField: "X-Product-Id") + request.setValue(UUID().uuidString, forHTTPHeaderField: "X-Request-Id") do { let (data, response) = try await URLSession.shared.data(for: request) diff --git a/packages/swift-platform-sdk/Sources/BLLicenseClient.swift b/packages/swift-platform-sdk/Sources/BLLicenseClient.swift index 6a3320ee..f6926f19 100644 --- a/packages/swift-platform-sdk/Sources/BLLicenseClient.swift +++ b/packages/swift-platform-sdk/Sources/BLLicenseClient.swift @@ -94,7 +94,8 @@ public final class BLLicenseClient { /// Check license status without activating. public func checkStatus(key: String) async throws -> BLLicenseInfo { - let encodedKey = key.uppercased().trimmingCharacters(in: .whitespaces) + let trimmedKey = key.uppercased().trimmingCharacters(in: .whitespaces) + let encodedKey = trimmedKey.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? trimmedKey return try await client.request( path: "/api/licenses/status/\(encodedKey)", responseType: BLLicenseInfo.self