Skip to content

Commit

Permalink
Make OkHttpNetworkConnection serverAnon property public
Browse files Browse the repository at this point in the history
  • Loading branch information
mscwilson committed May 9, 2024
1 parent 07536ea commit 707dfa7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object Tracking {
@Composable
fun setup(namespace: String) : TrackerController {
// Replace this collector endpoint with your own
val networkConfig = NetworkConfiguration("https://23a6-82-26-43-253.ngrok.io", HttpMethod.POST)
val networkConfig = NetworkConfiguration("http://192.168.0.20:9090", HttpMethod.POST)
val trackerConfig = TrackerConfiguration("appID")
.logLevel(LogLevel.DEBUG)
.screenViewAutotracking(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,19 +303,8 @@ class Emitter(
*/
set(serverAnonymisation) {
field = serverAnonymisation
if (!isCustomNetworkConnection && builderFinished) {
networkConnection = emitTimeout?.let {
OkHttpNetworkConnectionBuilder(uri, context)
.method(httpMethod)
.tls(tlsVersions)
.emitTimeout(it)
.customPostPath(customPostPath)
.client(client)
.cookieJar(cookieJar)
.serverAnonymisation(serverAnonymisation)
.requestHeaders(requestHeaders)
.build()
}
if (!isCustomNetworkConnection && builderFinished && networkConnection is OkHttpNetworkConnection) {
(networkConnection as OkHttpNetworkConnection).serverAnonymisation = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class OkHttpNetworkConnection private constructor(builder: OkHttpNetworkConnecti
override val httpMethod: HttpMethod
private val emitTimeout: Int
private val customPostPath: String?
private val serverAnonymisation: Boolean
var serverAnonymisation: Boolean
private val requestHeaders: Map<String, String>?
private var client: OkHttpClient? = null
private val uriBuilder: Uri.Builder
Expand Down

0 comments on commit 707dfa7

Please sign in to comment.