summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qauthenticator.cpp
diff options
context:
space:
mode:
authorRobert Hogan <robert@roberthogan.net>2011-08-15 10:43:43 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-15 21:51:37 +0200
commit0536ec05c3a5ceedc7b928c5f96b7ff36398af04 (patch)
treea2af542d19db423bc068a1a30aaf451910feeee4 /src/network/kernel/qauthenticator.cpp
parent168fe50106b20b250cdc5499e17f48907bd00f53 (diff)
HTTP internals: send password even if no username is set
Setting only a password (no username) for HTTP requests does not result in the password being sent. Only cancel authentication if neither a username nor a password is set. Requiring a username was preventing user-less logins. Merge-request: 1250 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Task-number: QTBUG-15566 (cherry picked from commit 6057909d2b73c2c3aa01a0e9216714ef07fb652f) Change-Id: I23a52362e3e8cf114219accca2b548ceb9dccff7 Reviewed-on: http://codereview.qt.nokia.com/2940 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Diffstat (limited to 'src/network/kernel/qauthenticator.cpp')
-rw-r--r--src/network/kernel/qauthenticator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 4f7f4ed80d..0423e2224d 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -395,7 +395,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
case Basic:
if(realm.isEmpty())
this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
- if (user.isEmpty())
+ if (user.isEmpty() && password.isEmpty())
phase = Done;
break;
case Ntlm:
@@ -406,7 +406,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
if (options.value("stale").toLower() == "true")
phase = Start;
- if (user.isEmpty())
+ if (user.isEmpty() && password.isEmpty())
phase = Done;
break;
}