summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Hogan <robert@roberthogan.net>2011-08-15 08:43:43 (GMT)
committerPeter Hartmann <peter.hartmann@nokia.com>2011-08-15 08:44:31 (GMT)
commit6057909d2b73c2c3aa01a0e9216714ef07fb652f (patch)
treee90dbb4faca3b711cd46d819c789ce3db3d762f2
parent773a6df46243831dee7559f90e33d7eff3c5c71e (diff)
downloadQt-6057909d2b73c2c3aa01a0e9216714ef07fb652f.zip
Qt-6057909d2b73c2c3aa01a0e9216714ef07fb652f.tar.gz
Qt-6057909d2b73c2c3aa01a0e9216714ef07fb652f.tar.bz2
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
-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 4f7f4ed..0423e22 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;
}