Skip to content

Commit

Permalink
Make the initialisation resilient when the OkHttp intereceptor is cre…
Browse files Browse the repository at this point in the history
…ated before SDK config
  • Loading branch information
xgouchet committed Mar 4, 2021
1 parent d890710 commit cf6fe44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal object CoreFeature {
initializeClockSync(appContext)
setupInfoProviders(appContext, consent)
setupOkHttpClient(configuration.needsClearTextHttp)
firstPartyHostDetector = FirstPartyHostDetector(configuration.firstPartyHosts)
firstPartyHostDetector.addKnownHosts(configuration.firstPartyHosts)
setupExecutors()

initialized.set(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ internal class FirstPartyHostDetector(
}

fun addKnownHosts(hosts: List<String>) {
knownHosts = knownHosts + hosts
knownHosts = knownHosts + hosts.map { it.toLowerCase(Locale.US) }
}
}

0 comments on commit cf6fe44

Please sign in to comment.