File tree 2 files changed +12
-1
lines changed
src/main/java/fr/free/nrw/commons
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ dependencies {
53
53
api(' com.github.tony19:logback-android-classic:1.1.1-6' ) {
54
54
exclude group : ' com.google.android' , module : ' android'
55
55
}
56
+ implementation " com.squareup.okhttp3:logging-interceptor:4.2.0"
56
57
57
58
// Dependency injector
58
59
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() {
31
31
return new OkHttpClient .Builder ()
32
32
.cookieJar (SharedPreferenceCookieManager .getInstance ())
33
33
.cache (NET_CACHE )
34
- .addInterceptor (new HttpLoggingInterceptor (). setLevel ( HttpLoggingInterceptor . Level . BODY ))
34
+ .addInterceptor (getLoggingInterceptor ( ))
35
35
.addInterceptor (new UnsuccessfulResponseInterceptor ())
36
36
.addInterceptor (new CommonHeaderRequestInterceptor ())
37
37
.build ();
38
38
}
39
39
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
+
40
50
private static class CommonHeaderRequestInterceptor implements Interceptor {
41
51
@ Override @ NonNull public Response intercept (@ NonNull Chain chain ) throws IOException {
42
52
Request request = chain .request ().newBuilder ()
You can’t perform that action at this time.
0 commit comments