File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
iterableapi/src/main/java/com/iterable/iterableapi Expand file tree Collapse file tree 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) {
8282 if (triggerExpirationRefreshTime > 0 ) {
8383 scheduleAuthTokenRefresh (triggerExpirationRefreshTime );
8484 } 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" );
8686 }
8787 } 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 );
8989 }
9090 }
9191
Original file line number Diff line number Diff line change 88public class IterableLogger {
99
1010 public static void d (String tag , String msg ) {
11- if (isLoggableLevel (Log .DEBUG )) {
11+ if (isLoggable (Log .DEBUG )) {
1212 Log .d (tag , " 💚 " + msg );
1313 }
1414 }
@@ -59,7 +59,7 @@ public static void printInfo() {
5959
6060 private static boolean isLoggable (int messageLevel ) {
6161 boolean isDebug = ((IterableApi .getInstance ().getMainActivityContext ().getApplicationInfo ().flags & IterableApi .getInstance ().getMainActivityContext ().getApplicationInfo ().FLAG_DEBUGGABLE ) != 0 );
62- if (isDebug ){
62+ if (isDebug ) {
6363 return isLoggableLevel (messageLevel );
6464 }
6565 // 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) {
245245 Iterator <?> headerKeys = urlConnection .getRequestProperties ().keySet ().iterator ();
246246 while (headerKeys .hasNext ()) {
247247 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 " );
249252 }
250253 headerString .append ("}" );
251254 return headerString .toString ();
252255 }
253256
257+ private static boolean isSensitive (String key ) {
258+ return (key .equals (IterableConstants .HEADER_API_KEY )) || key .equals (IterableConstants .HEADER_SDK_AUTHORIZATION );
259+ }
260+
254261 @ Override
255262 protected void onPostExecute (IterableApiResponse response ) {
256263 boolean retryRequest = !response .success && response .responseCode >= 500 ;
You can’t perform that action at this time.
0 commit comments