[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

ap at apple.com ap at apple.com
Thu Oct 29 20:36:33 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 57df29c79f7977536eb903011af0c3d801fe169b
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 29 22:58:48 2009 +0000

            Reviewed by Brady Eidson.
    
            Basic authentication credentials are not sent automatically to top resources
            https://bugs.webkit.org/show_bug.cgi?id=29901
    
            No new tests - I don't want to pollute root directory of http tests to check for this rather
            minor issue.
    
            * platform/network/CredentialStorage.cpp:
            (WebCore::CredentialStorage::set): Changed to always preserve leading slash.
            (WebCore::CredentialStorage::getDefaultAuthenticationCredential): Made breaking out of the
            loop more explicit.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48909 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8d53645..4ce6138 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-09-29  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Brady Eidson.
+
+        Basic authentication credentials are not sent automatically to top resources
+        https://bugs.webkit.org/show_bug.cgi?id=29901
+
+        No new tests - I don't want to pollute root directory of http tests to check for this rather
+        minor issue.
+
+        * platform/network/CredentialStorage.cpp:
+        (WebCore::CredentialStorage::set): Changed to always preserve leading slash.
+        (WebCore::CredentialStorage::getDefaultAuthenticationCredential): Made breaking out of the
+        loop more explicit.
+
 2009-09-29  Pavel Feldman  <pfeldman at chromium.org>
 
         Reviewed by Oliver Hunt.
diff --git a/WebCore/platform/network/CredentialStorage.cpp b/WebCore/platform/network/CredentialStorage.cpp
index b7f4c01..407ed5b 100644
--- a/WebCore/platform/network/CredentialStorage.cpp
+++ b/WebCore/platform/network/CredentialStorage.cpp
@@ -60,6 +60,9 @@ static String originStringFromURL(const KURL& url)
 
 void CredentialStorage::set(const Credential& credential, const ProtectionSpace& protectionSpace, const KURL& url)
 {
+    ASSERT(url.protocolInHTTPFamily());
+    ASSERT(url.isValid());
+
     protectionSpaceToCredentialMap().set(protectionSpace, credential);
     
     ProtectionSpaceAuthenticationScheme scheme = protectionSpace.authenticationScheme();
@@ -70,14 +73,15 @@ void CredentialStorage::set(const Credential& credential, const ProtectionSpace&
         pair<HashMap<String, HashMap<String, Credential> >::iterator, bool> result = originToDefaultBasicCredentialMap().add(origin, pathToCredentialMap);
         
         // Remove the last path component that is not a directory to determine the subpath for which this credential applies.
+        // We keep a leading slash, but remove a trailing one.
         String path = url.path();
-        if (!path.endsWith("/")) {
+        ASSERT(path.length() > 0);
+        ASSERT(path[0] == '/');
+        if (path.length() > 1) {
             int index = path.reverseFind('/');
-            if (index != -1)
-                path = path.substring(0, index);
+            path = path.substring(0, index ? index : 1);
         }
-        if (path.endsWith("/") && path.length() > 1)
-            path = path.substring(0, path.length() - 1);
+        ASSERT(path.length() == 1 || path[path.length() - 1] != '/');
         
         result.first->second.set(path, credential);
     }
@@ -102,13 +106,13 @@ Credential CredentialStorage::getDefaultAuthenticationCredential(const KURL& url
     while (credential.isEmpty() && !path.isNull()) {
         int index = path.reverseFind('/');
         if (index == 0) {
-            path = String();
             credential = pathToCredentialMap.get("/");
+            break;
         } else if (index == -1) {
             // This case should never happen, as all HTTP URL paths should start with a leading /
             ASSERT_NOT_REACHED();
             credential = pathToCredentialMap.get(path);
-            path = String();
+            break;
         } else {
             path = path.substring(0, index);
             credential = pathToCredentialMap.get(path);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list