[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdelibs=5D_kioslave/http=3A_Fix_auth_warnings_when_?=
From:       Gregory Oestreicher <greg () kamago ! net>
Date:       2011-06-02 12:55:16
Message-ID: 20110602125516.45B8CA60A6 () git ! kde ! org
[Download RAW message or body]

Git commit 53730995400665b24be3186c7c475980d0e8cd79 by Gregory Oestreicher.
Committed on 02/06/2011 at 13:56.
Pushed by goestreicher into branch 'master'.

Fix auth warnings when authentication is legitimate

Consider the previous response code as well as the
current when checking if auth info should be sent
to the server, otherwise legitimate auth attempts
will generate a warning as the response code
is unlikely to be 401 or 407 (if authentication
succeeds that is).

REVIEW: 101493

M  +2    -2    kioslave/http/http.cpp     

http://commits.kde.org/kdelibs/53730995400665b24be3186c7c475980d0e8cd79

diff --git a/kioslave/http/http.cpp b/kioslave/http/http.cpp
index b4d3c65..7228309 100644
--- a/kioslave/http/http.cpp
+++ b/kioslave/http/http.cpp
@@ -4319,8 +4319,8 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ )
 {
   // Security check against bogus username intended to fool the user into
   // visiting a site they did not meant to.
-  if ((!m_request.url.user().isEmpty() && m_request.responseCode != 401) ||
-      (!m_request.proxyUrl.user().isEmpty() && m_request.responseCode != 407)) {
+  if ((!m_request.url.user().isEmpty() && m_request.prevResponseCode != 401 && \
m_request.responseCode != 401) || +      (!m_request.proxyUrl.user().isEmpty() && \
m_request.prevResponseCode != 407 && m_request.responseCode != 407)) {  const int \
                result = messageBox(WarningYesNo,
                                     i18nc("@warning: Security check on url "
                                           "being accessed", "You are about to "


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic