[BlackBerry] WWW-Authenticate header on 200 response pops up authentication dialog
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 May 2012 14:32:32 +0000 (14:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 May 2012 14:32:32 +0000 (14:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=85643

Patch by Liam Quinn <lquinn@rim.com> on 2012-05-07
Reviewed by George Staikos.

.:

RIM PR: 151992
Added manual test for WWW-Authenticate header on a 200 response.

* ManualTests/blackberry/http-auth-on-200.php: Added.

Source/WebCore:

RIM PR: 151992
Ignore WWW-Authenticate header if the response code is not 401.
Ignore Proxy-Authenticate header if the response code is not 407.

Manual test added to observe whether the authentication dialog appears on a 200 response with WWW-Authenticate.

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::handleNotifyHeaderReceived):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116308 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
ManualTests/blackberry/http-auth-on-200.php [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/blackberry/NetworkJob.cpp

index 6dd54f3..43d4a57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-05-07  Liam Quinn  <lquinn@rim.com>
+
+        [BlackBerry] WWW-Authenticate header on 200 response pops up authentication dialog
+        https://bugs.webkit.org/show_bug.cgi?id=85643
+
+        Reviewed by George Staikos.
+
+        RIM PR: 151992
+        Added manual test for WWW-Authenticate header on a 200 response.
+
+        * ManualTests/blackberry/http-auth-on-200.php: Added.
+
 2012-05-07  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt] Unreviewed trivial build fix: Don't include bytearraytestdata.h in the QtWebKit
diff --git a/ManualTests/blackberry/http-auth-on-200.php b/ManualTests/blackberry/http-auth-on-200.php
new file mode 100644 (file)
index 0000000..43831ce
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+  header('WWW-Authenticate: Basic realm="FAIL"');
+  header('HTTP/1.0 200 OK');
+  header('Content-Type: text/plain');
+  echo 'PASS if you did not see an authentication dialog';
+?>
index 184167a..9cd4a03 100644 (file)
@@ -1,3 +1,19 @@
+2012-05-07  Liam Quinn  <lquinn@rim.com>
+
+        [BlackBerry] WWW-Authenticate header on 200 response pops up authentication dialog
+        https://bugs.webkit.org/show_bug.cgi?id=85643
+
+        Reviewed by George Staikos.
+
+        RIM PR: 151992
+        Ignore WWW-Authenticate header if the response code is not 401.
+        Ignore Proxy-Authenticate header if the response code is not 407.
+
+        Manual test added to observe whether the authentication dialog appears on a 200 response with WWW-Authenticate.
+
+        * platform/network/blackberry/NetworkJob.cpp:
+        (WebCore::NetworkJob::handleNotifyHeaderReceived):
+
 2012-05-07  Alexander Pavlov  <apavlov@chromium.org>
 
         Web Inspector: [TextPrompt] Event listeners and CSS style are not removed on detachment
index 6de5e4d..42a9c3e 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);