Changeset 106307 in webkit
- Timestamp:
- Jan 30, 2012 5:25:08 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106306 r106307 1 2012-01-30 Christopher Hutten-Czapski <chutten@rim.com> 2 3 BlackBerry - Support Proxy-Authenticate headers when a proxy is configured 4 https://bugs.webkit.org/show_bug.cgi?id=77361 5 6 Though we have a proxy configured, we might not have the auth 7 credentials it requires. Support Proxy-Authenticate for that case. 8 9 Reviewed by George Staikos. 10 11 * platform/network/blackberry/NetworkJob.cpp: 12 (WebCore::NetworkJob::handleNotifyHeaderReceived): 13 (WebCore::NetworkJob::handleAuthHeader): 14 (WebCore::NetworkJob::sendRequestWithCredentials): 15 * platform/network/blackberry/NetworkJob.h: 16 * platform/network/blackberry/NetworkManager.cpp: 17 (WebCore::NetworkManager::startJob): 18 1 19 2012-01-27 James Robinson <jamesr@chromium.org> 2 20 -
trunk/Source/WebCore/platform/network/blackberry/NetworkJob.cpp
r104013 r106307 317 317 318 318 if (lowerKey == "www-authenticate") 319 handleAuthHeader(value); 319 handleAuthHeader(ProtectionSpaceServerHTTP, value); 320 else if (lowerKey == "proxy-authenticate" && !BlackBerry::Platform::Client::get()->getProxyAddress().empty()) 321 handleAuthHeader(ProtectionSpaceProxyHTTP, value); 320 322 321 323 if (equalIgnoringCase(key, BlackBerry::Platform::NetworkRequest::HEADER_BLACKBERRY_FTP)) … … 702 704 } 703 705 704 bool NetworkJob::handleAuthHeader(const String& header)706 bool NetworkJob::handleAuthHeader(const ProtectionSpaceServerType space, const String& header) 705 707 { 706 708 if (!m_handle) … … 714 716 715 717 if (equalIgnoringCase(header, "ntlm")) 716 sendRequestWithCredentials( ProtectionSpaceServerHTTP, ProtectionSpaceAuthenticationSchemeNTLM, "NTLM");718 sendRequestWithCredentials(space, ProtectionSpaceAuthenticationSchemeNTLM, "NTLM"); 717 719 718 720 // Extract the auth scheme and realm from the header. 719 721 size_t spacePos = header.find(' '); 720 722 if (spacePos == notFound) { 721 LOG(Network, " WWW-Authenticate field '%s' badly formatted: missing scheme.", header.utf8().data());723 LOG(Network, "%s-Authenticate field '%s' badly formatted: missing scheme.", space == ProtectionSpaceServerHTTP ? "WWW" : "Proxy", header.utf8().data()); 722 724 return false; 723 725 } … … 737 739 size_t realmPos = header.findIgnoringCase("realm=", spacePos); 738 740 if (realmPos == notFound) { 739 LOG(Network, " WWW-Authenticate field '%s' badly formatted: missing realm.", header.utf8().data());741 LOG(Network, "%s-Authenticate field '%s' badly formatted: missing realm.", space == ProtectionSpaceServerHTTP ? "WWW" : "Proxy", header.utf8().data()); 740 742 return false; 741 743 } … … 746 748 size_t endPos = header.find("\"", beginPos); 747 749 if (endPos == notFound) { 748 LOG(Network, " WWW-Authenticate field '%s' badly formatted: invalid realm.", header.utf8().data());750 LOG(Network, "%s-Authenticate field '%s' badly formatted: invalid realm.", space == ProtectionSpaceServerHTTP ? "WWW" : "Proxy", header.utf8().data()); 749 751 return false; 750 752 } … … 753 755 754 756 // Get the user's credentials and resend the request. 755 sendRequestWithCredentials( ProtectionSpaceServerHTTP, protectionSpaceScheme, realm);757 sendRequestWithCredentials(space, protectionSpaceScheme, realm); 756 758 757 759 return true; … … 797 799 return false; 798 800 799 ProtectionSpace protectionSpace(m_response.url().host(), m_response.url().port(), type, realm, scheme); 801 int port = 0; 802 if (type == ProtectionSpaceProxyHTTP) { 803 std::stringstream toPort(BlackBerry::Platform::Client::get()->getProxyPort()); 804 toPort >> port; 805 } else 806 port = m_response.url().port(); 807 808 ProtectionSpace protectionSpace((type == ProtectionSpaceProxyHTTP) ? BlackBerry::Platform::Client::get()->getProxyAddress().c_str() : m_response.url().host() 809 , port, type, realm, scheme); 800 810 801 811 // We've got the scheme and realm. Now we need a username and password. -
trunk/Source/WebCore/platform/network/blackberry/NetworkJob.h
r103487 r106307 130 130 // The server needs authentication credentials. Search in the 131 131 // CredentialStorage or prompt the user via dialog. 132 bool handleAuthHeader(const String& header);132 bool handleAuthHeader(const ProtectionSpaceServerType, const String& header); 133 133 134 134 bool handleFTPHeader(const String& header); -
trunk/Source/WebCore/platform/network/blackberry/NetworkManager.cpp
r102433 r106307 105 105 } else if (type == ProtectionSpaceServerFTP) 106 106 authType = BlackBerry::Platform::NetworkRequest::AuthFTP; 107 else if (type == ProtectionSpaceProxyHTTP) 108 authType = BlackBerry::Platform::NetworkRequest::AuthProxy; 107 109 108 110 if (authType != BlackBerry::Platform::NetworkRequest::AuthNone)
Note: See TracChangeset
for help on using the changeset viewer.