Skip to content

Commit 4dfb50d

Browse files
Merge pull request #35 from evgk/patch-1
Fix for cookies containing "=" in the value
2 parents c1b4ec9 + 19e7d7b commit 4dfb50d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/android/com/knowledgecode/cordova/websocket/ConnectionTask.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ private static void setCookie(Map<String, String> cookies, String host, String p
8383

8484
if (cookie != null) {
8585
for (String c : cookie.split(";")) {
86-
String[] pair = c.split("=");
87-
88-
if (pair.length == 2) {
89-
cookies.put(pair[0].trim(), pair[1].trim());
86+
int position = c.indexOf("=");
87+
if (position > 0) {
88+
String key = c.substring(0,position).trim();
89+
String value = c.substring(position+1).trim();
90+
cookies.put(key, value);
9091
}
9192
}
9293
}

0 commit comments

Comments
 (0)