[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:44:02 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 19630f311a2c117682e0222a64fe532573031b55
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 13 23:36:15 2009 +0000
Reviewed by Brady Eidson.
https://bugs.webkit.org/show_bug.cgi?id=30345
HTTP tests for credential handling fail on Tiger
We cannot prevent NSURLConnection from doing its credentil handling on Tiger anyway; so
let it do its work without intervention. Once again, we pass explicitly passed credentials
in URL, fixing regressions from Safari 3.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f87badb..b7ef721 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-10-13 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Brady Eidson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30345
+ HTTP tests for credential handling fail on Tiger
+
+ We cannot prevent NSURLConnection from doing its credentil handling on Tiger anyway; so
+ let it do its work without intervention. Once again, we pass explicitly passed credentials
+ in URL, fixing regressions from Safari 3.
+
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+ (WebCore::ResourceHandle::receivedCredential):
+
2009-10-13 Roland Steiner <rolandsteiner at google.com>
Reviewed by Adam Barth.
diff --git a/WebCore/platform/network/mac/ResourceHandleMac.mm b/WebCore/platform/network/mac/ResourceHandleMac.mm
index a088a8a..d9722fa 100644
--- a/WebCore/platform/network/mac/ResourceHandleMac.mm
+++ b/WebCore/platform/network/mac/ResourceHandleMac.mm
@@ -119,6 +119,7 @@ public:
}
};
+#ifndef BUILDING_ON_TIGER
static String encodeBasicAuthorization(const String& user, const String& password)
{
CString unencodedString = (user + ":" + password).utf8();
@@ -128,6 +129,7 @@ static String encodeBasicAuthorization(const String& user, const String& passwor
base64Encode(unencoded, encoded);
return String(encoded.data(), encoded.size());
}
+#endif
ResourceHandleInternal::~ResourceHandleInternal()
{
@@ -175,14 +177,19 @@ bool ResourceHandle::start(Frame* frame)
} else
delegate = ResourceHandle::delegate();
- if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !d->m_request.url().protocolInHTTPFamily()) {
+ if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty())
+#ifndef BUILDING_ON_TIGER
+ && !d->m_request.url().protocolInHTTPFamily() // On Tiger, always pass credentials in URL, so that they get stored even if the request gets cancelled right away.
+#endif
+ ) {
// Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
KURL urlWithCredentials(d->m_request.url());
urlWithCredentials.setUser(d->m_user);
urlWithCredentials.setPass(d->m_pass);
d->m_request.setURL(urlWithCredentials);
}
-
+
+#ifndef BUILDING_ON_TIGER
if ((!client() || client()->shouldUseCredentialStorage(this)) && d->m_request.url().protocolInHTTPFamily()) {
if (d->m_user.isEmpty() && d->m_pass.isEmpty()) {
// <rdar://problem/7174050> - For URLs that match the paths of those previously challenged for HTTP Basic authentication,
@@ -201,6 +208,7 @@ bool ResourceHandle::start(Frame* frame)
String authHeader = "Basic " + encodeBasicAuthorization(d->m_initialCredential.user(), d->m_initialCredential.password());
d->m_request.addHTTPHeaderField("Authorization", authHeader);
}
+#endif
if (!ResourceHandle::didSendBodyDataDelegateExists())
associateStreamWithResourceHandle([d->m_request.nsURLRequest() HTTPBodyStream], this);
@@ -491,6 +499,7 @@ void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChall
return;
}
+#ifndef BUILDING_ON_TIGER
if (!challenge.previousFailureCount() && (!client() || client()->shouldUseCredentialStorage(this))) {
Credential credential = CredentialStorage::get(challenge.protectionSpace());
if (!credential.isEmpty() && credential != d->m_initialCredential) {
@@ -499,6 +508,7 @@ void ResourceHandle::didReceiveAuthenticationChallenge(const AuthenticationChall
return;
}
}
+#endif
d->m_currentMacChallenge = challenge.nsURLAuthenticationChallenge();
NSURLAuthenticationChallenge *webChallenge = [[NSURLAuthenticationChallenge alloc] initWithAuthenticationChallenge:d->m_currentMacChallenge
@@ -530,11 +540,6 @@ void ResourceHandle::receivedCredential(const AuthenticationChallenge& challenge
if (credential.persistence() == CredentialPersistenceNone) {
// NSURLCredentialPersistenceNone doesn't work on Tiger, so we have to use session persistence.
Credential webCredential(credential.user(), credential.password(), CredentialPersistenceForSession);
- KURL urlToStore;
- if (challenge.failureResponse().httpStatusCode() == 401)
- urlToStore = d->m_request.url();
- CredentialStorage::set(webCredential, core([d->m_currentMacChallenge protectionSpace]), urlToStore);
-
[[d->m_currentMacChallenge sender] useCredential:mac(webCredential) forAuthenticationChallenge:d->m_currentMacChallenge];
} else
#else
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list