mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
fix: add User-Agent to NetworkingModule http client
This commit is contained in:
parent
b9f353bb5a
commit
2697988bbc
1 changed files with 2 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import dagger.Provides
|
||||||
import fr.free.nrw.commons.BetaConstants
|
import fr.free.nrw.commons.BetaConstants
|
||||||
import fr.free.nrw.commons.BuildConfig
|
import fr.free.nrw.commons.BuildConfig
|
||||||
import fr.free.nrw.commons.OkHttpConnectionFactory
|
import fr.free.nrw.commons.OkHttpConnectionFactory
|
||||||
|
import fr.free.nrw.commons.OkHttpConnectionFactory.CommonHeaderRequestInterceptor
|
||||||
import fr.free.nrw.commons.actions.PageEditClient
|
import fr.free.nrw.commons.actions.PageEditClient
|
||||||
import fr.free.nrw.commons.actions.PageEditInterface
|
import fr.free.nrw.commons.actions.PageEditInterface
|
||||||
import fr.free.nrw.commons.actions.ThanksInterface
|
import fr.free.nrw.commons.actions.ThanksInterface
|
||||||
|
|
@ -60,6 +61,7 @@ class NetworkingModule {
|
||||||
.connectTimeout(120, TimeUnit.SECONDS)
|
.connectTimeout(120, TimeUnit.SECONDS)
|
||||||
.writeTimeout(120, TimeUnit.SECONDS)
|
.writeTimeout(120, TimeUnit.SECONDS)
|
||||||
.addInterceptor(httpLoggingInterceptor)
|
.addInterceptor(httpLoggingInterceptor)
|
||||||
|
.addInterceptor(CommonHeaderRequestInterceptor())
|
||||||
.readTimeout(120, TimeUnit.SECONDS)
|
.readTimeout(120, TimeUnit.SECONDS)
|
||||||
.cache(Cache(File(context.cacheDir, "okHttpCache"), OK_HTTP_CACHE_SIZE))
|
.cache(Cache(File(context.cacheDir, "okHttpCache"), OK_HTTP_CACHE_SIZE))
|
||||||
.build()
|
.build()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue