summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-08-17 09:19:23 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-08-17 09:19:23 -0700
commit86192c614c317b428e10c2dc9052a07304aa6c3f (patch)
tree779d514da44696882269d07396839711c5ea299f
parent6ba7ae1e4c3c04f6a71380b913ad79f83b00a628 (diff)
parentdbdad99813be49f2a64b876507ae18db42db7bbc (diff)
downloadframeworks_base-86192c614c317b428e10c2dc9052a07304aa6c3f.zip
frameworks_base-86192c614c317b428e10c2dc9052a07304aa6c3f.tar.gz
frameworks_base-86192c614c317b428e10c2dc9052a07304aa6c3f.tar.bz2
Merge change 21442 into eclair
* changes: Fix a cookie bug. If "secure" is in the end of the string, it was ignored.
-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;