Changeset 59185 in webkit
- Timestamp:
- May 11, 2010 4:41:25 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r59180 r59185 1 2010-05-11 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Brady Eidson. 4 5 https://bugs.webkit.org/show_bug.cgi?id=37989 6 Safari (still) doesn't always send basic credentials preemptively 7 8 These resources shouldn't be reused for any other test. 9 10 * http/tests/xmlhttprequest/basic-auth-default-expected.txt: Added. 11 * http/tests/xmlhttprequest/basic-auth-default.html: Added. 12 * http/tests/xmlhttprequest/resources/basic-auth-default: Added. 13 * http/tests/xmlhttprequest/resources/basic-auth-default/dir1: Added. 14 * http/tests/xmlhttprequest/resources/basic-auth-default/dir1/basic-auth.php: Added. 15 * http/tests/xmlhttprequest/resources/basic-auth-default/dir2: Added. 16 * http/tests/xmlhttprequest/resources/basic-auth-default/dir2/basic-auth.php: Added. 17 * http/tests/xmlhttprequest/resources/basic-auth-default/dir2/catch.php: Added. 18 1 19 2010-05-11 Jian Li <jianli@chromium.org> 2 20 -
trunk/WebCore/ChangeLog
r59183 r59185 1 2010-05-11 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Brady Eidson. 4 5 https://bugs.webkit.org/show_bug.cgi?id=37989 6 Safari (still) doesn't always send basic credentials preemptively 7 8 Test: http/tests/xmlhttprequest/basic-auth-default.html 9 10 After fetching credentials from WebCore storage, put them back right away. This will add 11 default credentials for the directory, since this may be the first time we learn about its 12 associated protection space. 13 14 * platform/network/cf/ResourceHandleCFNet.cpp: 15 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): 16 (WebCore::WebCoreSynchronousLoader::didReceiveChallenge): 17 * platform/network/mac/ResourceHandleMac.mm: 18 (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): 19 (-[WebCoreSynchronousLoader connection:didReceiveAuthenticationChallenge:]): 20 1 21 2010-05-11 Kevin Watters <kevinwatters@gmail.com> 2 22 -
trunk/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
r57995 r59185 515 515 if (!credential.isEmpty() && credential != d->m_initialCredential) { 516 516 ASSERT(credential.persistence() == CredentialPersistenceNone); 517 if (challenge.failureResponse().httpStatusCode() == 401) { 518 // Store the credential back, possibly adding it as a default for this directory. 519 CredentialStorage::set(credential, challenge.protectionSpace(), d->m_request.url()); 520 } 517 521 RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(credential)); 518 522 CFURLConnectionUseCredential(d->m_connection.get(), cfCredential.get(), challenge.cfURLAuthChallengeRef()); … … 725 729 WebCoreSynchronousLoader* loader = static_cast<WebCoreSynchronousLoader*>(const_cast<void*>(clientInfo)); 726 730 731 CFURLResponseRef urlResponse = (CFURLResponseRef)CFURLAuthChallengeGetFailureResponse(challenge); 732 CFHTTPMessageRef httpResponse = urlResponse ? CFURLResponseGetHTTPResponse(urlResponse) : 0; 733 727 734 if (loader->m_user && loader->m_pass) { 728 735 Credential credential(loader->m_user.get(), loader->m_pass.get(), CredentialPersistenceNone); 729 736 RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(credential)); 730 737 731 CFURLResponseRef urlResponse = (CFURLResponseRef)CFURLAuthChallengeGetFailureResponse(challenge);732 CFHTTPMessageRef httpResponse = urlResponse ? CFURLResponseGetHTTPResponse(urlResponse) : 0;733 738 KURL urlToStore; 734 739 if (httpResponse && CFHTTPMessageGetResponseStatusCode(httpResponse) == 401) … … 746 751 if (!credential.isEmpty() && credential != loader->m_initialCredential) { 747 752 ASSERT(credential.persistence() == CredentialPersistenceNone); 753 if (httpResponse && CFHTTPMessageGetResponseStatusCode(httpResponse) == 401) { 754 // Store the credential back, possibly adding it as a default for this directory. 755 CredentialStorage::set(credential, core(CFURLAuthChallengeGetProtectionSpace(challenge)), loader->m_url.get()); 756 } 748 757 RetainPtr<CFURLCredentialRef> cfCredential(AdoptCF, createCF(credential)); 749 758 CFURLConnectionUseCredential(conn, cfCredential.get(), challenge); -
trunk/WebCore/platform/network/mac/ResourceHandleMac.mm
r58442 r59185 544 544 if (!credential.isEmpty() && credential != d->m_initialCredential) { 545 545 ASSERT(credential.persistence() == CredentialPersistenceNone); 546 if (challenge.failureResponse().httpStatusCode() == 401) { 547 // Store the credential back, possibly adding it as a default for this directory. 548 CredentialStorage::set(credential, challenge.protectionSpace(), d->m_request.url()); 549 } 546 550 [challenge.sender() useCredential:mac(credential) forAuthenticationChallenge:mac(challenge)]; 547 551 return; … … 1035 1039 if (!credential.isEmpty() && credential != m_initialCredential) { 1036 1040 ASSERT(credential.persistence() == CredentialPersistenceNone); 1041 if ([[challenge failureResponse] isKindOfClass:[NSHTTPURLResponse class]] && [(NSHTTPURLResponse *)[challenge failureResponse] statusCode] == 401) { 1042 // Store the credential back, possibly adding it as a default for this directory. 1043 CredentialStorage::set(credential, core([challenge protectionSpace]), m_url); 1044 } 1037 1045 [[challenge sender] useCredential:mac(credential) forAuthenticationChallenge:challenge]; 1038 1046 return;
Note: See TracChangeset
for help on using the changeset viewer.