Skip to content
This repository was archived by the owner on Jan 24, 2020. It is now read-only.

Commit 819b2d4

Browse files
foloinfojoeferraro
authored andcommitted
call trim() on key for cookie (android) (#19)
* call trim() on key for cookie (android) * FIXED ArrayIndexOutOfBoundsException
1 parent 64f80cb commit 819b2d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

android/src/main/java/com/psykar/cookiemanager/CookieManagerModule.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ public void get(String url, Callback callback) throws URISyntaxException, IOExce
6363
String[] cookies = cookieList.get(0).split(";");
6464
for (int i = 0; i < cookies.length; i++) {
6565
String[] cookie = cookies[i].split("=");
66-
map.putString(cookie[0], cookie[1]);
66+
if(cookie.length > 1) {
67+
map.putString(cookie[0].trim(), cookie[1]);
68+
}
6769
}
6870
}
6971
callback.invoke(null, map);

0 commit comments

Comments
 (0)