File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/main/java/fr/free/nrw/commons Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ dependencies {
5353 api(' com.github.tony19:logback-android-classic:1.1.1-6' ) {
5454 exclude group : ' com.google.android' , module : ' android'
5555 }
56+ implementation " com.squareup.okhttp3:logging-interceptor:4.2.0"
5657
5758 // Dependency injector
5859 implementation " com.google.dagger:dagger:$DAGGER_VERSION "
Original file line number Diff line number Diff line change @@ -31,12 +31,22 @@ private static OkHttpClient createClient() {
3131 return new OkHttpClient .Builder ()
3232 .cookieJar (SharedPreferenceCookieManager .getInstance ())
3333 .cache (NET_CACHE )
34- .addInterceptor (new HttpLoggingInterceptor (). setLevel ( HttpLoggingInterceptor . Level . BODY ))
34+ .addInterceptor (getLoggingInterceptor ( ))
3535 .addInterceptor (new UnsuccessfulResponseInterceptor ())
3636 .addInterceptor (new CommonHeaderRequestInterceptor ())
3737 .build ();
3838 }
3939
40+ private static HttpLoggingInterceptor getLoggingInterceptor () {
41+ HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor ()
42+ .setLevel (HttpLoggingInterceptor .Level .BASIC );
43+
44+ httpLoggingInterceptor .redactHeader ("Authorization" );
45+ httpLoggingInterceptor .redactHeader ("Cookie" );
46+
47+ return httpLoggingInterceptor ;
48+ }
49+
4050 private static class CommonHeaderRequestInterceptor implements Interceptor {
4151 @ Override @ NonNull public Response intercept (@ NonNull Chain chain ) throws IOException {
4252 Request request = chain .request ().newBuilder ()
You can’t perform that action at this time.
0 commit comments