Lazily instantiate Cloudflare client

This commit is contained in:
arkon 2020-06-24 18:07:29 -04:00
parent a5339969c9
commit b3f5f13c39

View File

@ -61,8 +61,10 @@ class NetworkHelper(context: Context) {
builder.build() builder.build()
} }
val cloudflareClient = client.newBuilder() val cloudflareClient by lazy {
.addInterceptor(UserAgentInterceptor()) client.newBuilder()
.addInterceptor(CloudflareInterceptor(context)) .addInterceptor(UserAgentInterceptor())
.build() .addInterceptor(CloudflareInterceptor(context))
.build()
}
} }