OSDN Git Service

Fix for bug 3407633 Cookie not set in CookieManager - DO NOT MERGE
authorKristian Monsen <kristianm@google.com>
Tue, 1 Feb 2011 15:12:31 +0000 (15:12 +0000)
committerKristian Monsen <kristianm@google.com>
Tue, 1 Feb 2011 15:14:11 +0000 (15:14 +0000)
Setting http:// at the start if there is no :// in the url

Change-Id: Idfae4f724808267fe9c8ab3864cfc4305ddac0e7

core/java/android/webkit/CookieManager.java

index ff9fe1c..1fea65a 100644 (file)
@@ -294,6 +294,8 @@ public final class CookieManager {
      */
     public void setCookie(String url, String value) {
         if (JniUtil.useChromiumHttpStack()) {
+            if (url.indexOf("://") == -1)
+                url = "http://" + url;
             nativeSetCookie(url, value);
             return;
         }
@@ -425,6 +427,8 @@ public final class CookieManager {
      */
     public String getCookie(String url) {
         if (JniUtil.useChromiumHttpStack()) {
+            if (url.indexOf("://") == -1)
+                url = "http://" + url;
             return nativeGetCookie(url);
         }