File tree Expand file tree Collapse file tree
src/main/java/com/taboola/rest/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import com .taboola .rest .api .internal .config .SerializationConfig ;
2121import com .taboola .rest .api .internal .config .UserAgentHeader ;
2222import com .taboola .rest .api .internal .serialization .SerializationMapperCreator ;
23+ import com .taboola .rest .api .model .HttpLoggingLevel ;
2324import com .taboola .rest .api .model .RequestHeader ;
2425import com .taboola .rest .api .model .StringResponseFactory ;
2526
Original file line number Diff line number Diff line change @@ -32,12 +32,13 @@ private HttpLoggingInterceptor createLoggingInterceptor(CommunicationConfig conf
3232 HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor (new CommunicationInterceptor ());
3333 if (config .isDebug ()) {
3434 loggingInterceptor .setLevel (HttpLoggingInterceptor .Level .BODY );
35- loggingInterceptor .redactHeader ("Authorization" );
36- loggingInterceptor .redactHeader ("Cookie" );
3735 } else {
3836 loggingInterceptor .setLevel (config .getLoggingLevel ());
3937 }
40-
38+ if (loggingInterceptor .getLevel () == HttpLoggingInterceptor .Level .BODY ) {
39+ loggingInterceptor .redactHeader ("Authorization" );
40+ loggingInterceptor .redactHeader ("Cookie" );
41+ }
4142 return loggingInterceptor ;
4243 }
4344
Original file line number Diff line number Diff line change 1- package com .taboola .rest .api ;
1+ package com .taboola .rest .api . model ;
22
33import okhttp3 .logging .HttpLoggingInterceptor ;
44
You can’t perform that action at this time.
0 commit comments