File tree 3 files changed +12
-5
lines changed
iterableapi/src/main/java/com/iterable/iterableapi
3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,10 @@ public void queueExpirationRefresh(String encodedJWT) {
82
82
if (triggerExpirationRefreshTime > 0 ) {
83
83
scheduleAuthTokenRefresh (triggerExpirationRefreshTime );
84
84
} else {
85
- IterableLogger .w (TAG , "The expiringAuthTokenRefreshPeriod has already passed for the current JWT " + encodedJWT );
85
+ IterableLogger .w (TAG , "The expiringAuthTokenRefreshPeriod has already passed for the current JWT" );
86
86
}
87
87
} catch (Exception e ) {
88
- IterableLogger .e (TAG , "Error while parsing JWT for the expiration: " + encodedJWT , e );
88
+ IterableLogger .e (TAG , "Error while parsing JWT for the expiration" , e );
89
89
}
90
90
}
91
91
Original file line number Diff line number Diff line change 8
8
public class IterableLogger {
9
9
10
10
public static void d (String tag , String msg ) {
11
- if (isLoggableLevel (Log .DEBUG )) {
11
+ if (isLoggable (Log .DEBUG )) {
12
12
Log .d (tag , " 💚 " + msg );
13
13
}
14
14
}
@@ -59,7 +59,7 @@ public static void printInfo() {
59
59
60
60
private static boolean isLoggable (int messageLevel ) {
61
61
boolean isDebug = ((IterableApi .getInstance ().getMainActivityContext ().getApplicationInfo ().flags & IterableApi .getInstance ().getMainActivityContext ().getApplicationInfo ().FLAG_DEBUGGABLE ) != 0 );
62
- if (isDebug ){
62
+ if (isDebug ) {
63
63
return isLoggableLevel (messageLevel );
64
64
}
65
65
// Log level will be set to WARNING and above if in release mode.
Original file line number Diff line number Diff line change @@ -245,12 +245,19 @@ private static String buildHeaderString(HttpURLConnection urlConnection) {
245
245
Iterator <?> headerKeys = urlConnection .getRequestProperties ().keySet ().iterator ();
246
246
while (headerKeys .hasNext ()) {
247
247
String key = (String ) headerKeys .next ();
248
- headerString .append (key + " : " + urlConnection .getRequestProperties ().get (key ) + "\n " );
248
+ if (isSensitive (key )) {
249
+ continue ;
250
+ }
251
+ headerString .append (key ).append (" : " ).append (urlConnection .getRequestProperties ().get (key )).append ("\n " );
249
252
}
250
253
headerString .append ("}" );
251
254
return headerString .toString ();
252
255
}
253
256
257
+ private static boolean isSensitive (String key ) {
258
+ return (key .equals (IterableConstants .HEADER_API_KEY )) || key .equals (IterableConstants .HEADER_SDK_AUTHORIZATION );
259
+ }
260
+
254
261
@ Override
255
262
protected void onPostExecute (IterableApiResponse response ) {
256
263
boolean retryRequest = !response .success && response .responseCode >= 500 ;
You can’t perform that action at this time.
0 commit comments