Commit fda0a1b6 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

[BlackBerry] Reverting implementation for 407 error pages

https://bugs.webkit.org/show_bug.cgi?id=97455

Patch by Otto Derek Cheung <otcheung@rim.com> on 2012-09-24
Reviewed by Rob Buis.

Revert "[BlackBerry] Show custom error page when 407 is received"
This reverts commit e6d14529428fe47916fcb997528095b8acad2f2b.

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::handleNotifyStatusReceived):
(WebCore::NetworkJob::notifyAuthReceived):
(WebCore::NetworkJob::sendRequestWithCredentials):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c4157489
2012-09-24 Otto Derek Cheung <otcheung@rim.com>
[BlackBerry] Reverting implementation for 407 error pages
https://bugs.webkit.org/show_bug.cgi?id=97455
Reviewed by Rob Buis.
Revert "[BlackBerry] Show custom error page when 407 is received"
This reverts commit e6d14529428fe47916fcb997528095b8acad2f2b.
* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::handleNotifyStatusReceived):
(WebCore::NetworkJob::notifyAuthReceived):
(WebCore::NetworkJob::sendRequestWithCredentials):
2012-09-24 Sheriff Bot <webkit.review.bot@gmail.com>
 
Unreviewed, rolling out r129388.
......@@ -192,12 +192,6 @@ void NetworkJob::handleNotifyStatusReceived(int status, const String& message)
if (isInfo(status))
return; // ignore
// Load up error page and ask the user to change their wireless proxy settings
if (status == 407) {
const ResourceError error = ResourceError(ResourceError::httpErrorDomain, BlackBerry::Platform::FilterStream::StatusWifiProxyAuthError, m_response.url().string(), emptyString());
m_handle->client()->didFail(m_handle.get(), error);
}
m_statusReceived = true;
// Convert non-HTTP status codes to generic HTTP codes.
......@@ -300,10 +294,11 @@ void NetworkJob::notifyAuthReceived(BlackBerry::Platform::NetworkRequest::AuthTy
}
storeCredentials();
return;
} else {
purgeCredentials();
m_newJobWithCredentialsStarted = sendRequestWithCredentials(serverType, scheme, realm, requireCredentials);
}
purgeCredentials();
m_newJobWithCredentialsStarted = sendRequestWithCredentials(serverType, scheme, realm, requireCredentials);
}
void NetworkJob::notifyStringHeaderReceived(const String& key, const String& value)
......@@ -733,8 +728,15 @@ bool NetworkJob::sendRequestWithCredentials(ProtectionSpaceServerType type, Prot
String host;
int port;
host = m_response.url().host();
port = m_response.url().port();
if (type == ProtectionSpaceProxyHTTP) {
String proxyAddress = BlackBerry::Platform::Client::get()->getProxyAddress(newURL.string().ascii().data()).c_str();
KURL proxyURL(KURL(), proxyAddress);
host = proxyURL.host();
port = proxyURL.port();
} else {
host = m_response.url().host();
port = m_response.url().port();
}
ProtectionSpace protectionSpace(host, port, type, realm, scheme);
......@@ -761,30 +763,37 @@ bool NetworkJob::sendRequestWithCredentials(ProtectionSpaceServerType type, Prot
String username;
String password;
// Before asking the user for credentials, we check if the URL contains that.
if (!m_handle->getInternal()->m_user.isEmpty() && !m_handle->getInternal()->m_pass.isEmpty()) {
username = m_handle->getInternal()->m_user;
password = m_handle->getInternal()->m_pass;
// Prevent them from been used again if they are wrong.
// If they are correct, they will the put into CredentialStorage.
m_handle->getInternal()->m_user = "";
m_handle->getInternal()->m_pass = "";
} else {
if (m_handle->firstRequest().targetType() != ResourceRequest::TargetIsMainFrame && BlackBerry::Platform::Settings::instance()->isChromeProcess())
return false;
m_handle->getInternal()->m_currentWebChallenge = AuthenticationChallenge();
m_isAuthenticationChallenging = true;
updateDeferLoadingCount(1);
if (type == ProtectionSpaceProxyHTTP) {
username = BlackBerry::Platform::Client::get()->getProxyUsername().c_str();
password = BlackBerry::Platform::Client::get()->getProxyPassword().c_str();
}
AuthenticationChallengeManager::instance()->authenticationChallenge(newURL,
protectionSpace,
Credential(),
this,
m_frame->page()->chrome()->client()->platformPageClient());
return true;
if (username.isEmpty() || password.isEmpty()) {
// Before asking the user for credentials, we check if the URL contains that.
if (!m_handle->getInternal()->m_user.isEmpty() && !m_handle->getInternal()->m_pass.isEmpty()) {
username = m_handle->getInternal()->m_user;
password = m_handle->getInternal()->m_pass;
// Prevent them from been used again if they are wrong.
// If they are correct, they will the put into CredentialStorage.
m_handle->getInternal()->m_user = "";
m_handle->getInternal()->m_pass = "";
} else {
if (m_handle->firstRequest().targetType() != ResourceRequest::TargetIsMainFrame && BlackBerry::Platform::Settings::instance()->isChromeProcess())
return false;
m_handle->getInternal()->m_currentWebChallenge = AuthenticationChallenge();
m_isAuthenticationChallenging = true;
updateDeferLoadingCount(1);
AuthenticationChallengeManager::instance()->authenticationChallenge(newURL,
protectionSpace,
Credential(),
this,
m_frame->page()->chrome()->client()->platformPageClient());
return true;
}
}
credential = Credential(username, password, CredentialPersistenceForSession);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment