[BlackBerry] WWW-Authenticate header on 200 response pops up authentication dialog
[WebKit-https.git] / Source / WebCore / platform / network / blackberry / NetworkJob.cpp
index 6de5e4dbd4e56d29fae5f7968fac7e9e8b9c7f72..42a9c3e11ff40eb3d6e61a5744a386211b02a348 100644 (file)
@@ -314,9 +314,9 @@ void NetworkJob::handleNotifyHeaderReceived(const String& key, const String& val
             m_response.setHTTPHeaderField(key, m_response.httpHeaderField(key) + "\r\n" + value);
             return;
         }
-    } else if (lowerKey == "www-authenticate")
+    } else if (m_extendedStatusCode == 401 && lowerKey == "www-authenticate")
         handleAuthHeader(ProtectionSpaceServerHTTP, value);
-    else if (lowerKey == "proxy-authenticate" && !BlackBerry::Platform::Client::get()->getProxyAddress().empty())
+    else if (m_extendedStatusCode == 407 && lowerKey == "proxy-authenticate" && !BlackBerry::Platform::Client::get()->getProxyAddress().empty())
         handleAuthHeader(ProtectionSpaceProxyHTTP, value);
     else if (equalIgnoringCase(key, BlackBerry::Platform::NetworkRequest::HEADER_BLACKBERRY_FTP))
         handleFTPHeader(value);