Description
Describe the bug
We're running the ConfigCat Proxy (v0.4.2) and have set a custom baseUrl
. The initial config fetch works however subsequent fetches do not.
The issue lies in how preferences from the response are being handled:
kotlin-sdk/src/commonMain/kotlin/com/configcat/fetch/ConfigFetcher.kt
Lines 33 to 39 in ea7a1fb
response.entry.config.preferences?.baseUrl
is https://cdn-global.configcat.com
. As such, baseUrl.update { "https://cdn-global.configcat.com" }
is being called, which breaks the client.
I'm not sure if this should be fixed in the client or if the proxy should be re-writing the baseUrl.
I also don't love that the redirect
preference can force the baseUrl
to update when using the proxy.
SDK version
com.configcat:configcat-kotlin-client-jvm:3.0.0
SDK configuration
ConfigCatClient("configcat-proxy/my-sdk") {
baseUrl = "http://proxy-url"
}
Logs
2024-04-09 16:44:59 UTC [ERROR]: ConfigCat - [1100] Your SDK Key seems to be wrong. You can find the valid SDK Key at https://app.configcat.com/sdkkey. Received response: 403
Language/Framework version
Kotlin 1.9.23
Java 21
Platform
Mac/Linux