summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-08-17 10:59:21 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-08-17 10:59:21 -0700
commit78eab1b141cf45a0d92de4a31afe3941e61009f0 (patch)
tree0622a3ec7453869c975fc991ddd53cae6717287f /core
parent5dd98cc0c3cb99c342c2416f68bf602655701866 (diff)
parent86192c614c317b428e10c2dc9052a07304aa6c3f (diff)
downloadframeworks_base-78eab1b141cf45a0d92de4a31afe3941e61009f0.zip
frameworks_base-78eab1b141cf45a0d92de4a31afe3941e61009f0.tar.gz
frameworks_base-78eab1b141cf45a0d92de4a31afe3941e61009f0.tar.bz2
am 86192c61: Merge change 21442 into eclair
Merge commit '86192c614c317b428e10c2dc9052a07304aa6c3f' * commit '86192c614c317b428e10c2dc9052a07304aa6c3f': Fix a cookie bug. If "secure" is in the end of the string, it was ignored.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/webkit/CookieManager.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java
index d188a39..fca591f 100644
--- a/core/java/android/webkit/CookieManager.java
+++ b/core/java/android/webkit/CookieManager.java
@@ -833,22 +833,24 @@ public final class CookieManager {
// "secure" is a known attribute doesn't use "=";
// while sites like live.com uses "secure="
- if (length - index > SECURE_LENGTH
+ if (length - index >= SECURE_LENGTH
&& cookieString.substring(index, index + SECURE_LENGTH).
equalsIgnoreCase(SECURE)) {
index += SECURE_LENGTH;
cookie.secure = true;
+ if (index == length) break;
if (cookieString.charAt(index) == EQUAL) index++;
continue;
}
// "httponly" is a known attribute doesn't use "=";
// while sites like live.com uses "httponly="
- if (length - index > HTTP_ONLY_LENGTH
+ if (length - index >= HTTP_ONLY_LENGTH
&& cookieString.substring(index,
index + HTTP_ONLY_LENGTH).
equalsIgnoreCase(HTTP_ONLY)) {
index += HTTP_ONLY_LENGTH;
+ if (index == length) break;
if (cookieString.charAt(index) == EQUAL) index++;
// FIXME: currently only parse the attribute
continue;