Merge change 21442 into eclair
* changes: Fix a cookie bug. If "secure" is in the end of the string, it was ignored.
This commit is contained in:
@@ -833,22 +833,24 @@ public final class CookieManager {
|
|||||||
|
|
||||||
// "secure" is a known attribute doesn't use "=";
|
// "secure" is a known attribute doesn't use "=";
|
||||||
// while sites like live.com uses "secure="
|
// while sites like live.com uses "secure="
|
||||||
if (length - index > SECURE_LENGTH
|
if (length - index >= SECURE_LENGTH
|
||||||
&& cookieString.substring(index, index + SECURE_LENGTH).
|
&& cookieString.substring(index, index + SECURE_LENGTH).
|
||||||
equalsIgnoreCase(SECURE)) {
|
equalsIgnoreCase(SECURE)) {
|
||||||
index += SECURE_LENGTH;
|
index += SECURE_LENGTH;
|
||||||
cookie.secure = true;
|
cookie.secure = true;
|
||||||
|
if (index == length) break;
|
||||||
if (cookieString.charAt(index) == EQUAL) index++;
|
if (cookieString.charAt(index) == EQUAL) index++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// "httponly" is a known attribute doesn't use "=";
|
// "httponly" is a known attribute doesn't use "=";
|
||||||
// while sites like live.com uses "httponly="
|
// while sites like live.com uses "httponly="
|
||||||
if (length - index > HTTP_ONLY_LENGTH
|
if (length - index >= HTTP_ONLY_LENGTH
|
||||||
&& cookieString.substring(index,
|
&& cookieString.substring(index,
|
||||||
index + HTTP_ONLY_LENGTH).
|
index + HTTP_ONLY_LENGTH).
|
||||||
equalsIgnoreCase(HTTP_ONLY)) {
|
equalsIgnoreCase(HTTP_ONLY)) {
|
||||||
index += HTTP_ONLY_LENGTH;
|
index += HTTP_ONLY_LENGTH;
|
||||||
|
if (index == length) break;
|
||||||
if (cookieString.charAt(index) == EQUAL) index++;
|
if (cookieString.charAt(index) == EQUAL) index++;
|
||||||
// FIXME: currently only parse the attribute
|
// FIXME: currently only parse the attribute
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user