diff options
author | Robert Hogan <robert@webkit.org> | 2010-11-01 11:44:47 (GMT) |
---|---|---|
committer | Qt Commercial Integration <QtCommercial@digia.com> | 2012-01-31 10:24:53 (GMT) |
commit | baba87e49b249b05277bb29af3e54f70fcbb3520 (patch) | |
tree | c9b9f00cbcd55ffeb0d695861cf6f73543207b5e /src | |
parent | eb728b5212b863770a8f2016b4bef34b99d2cfe4 (diff) | |
download | Qt-baba87e49b249b05277bb29af3e54f70fcbb3520.zip Qt-baba87e49b249b05277bb29af3e54f70fcbb3520.tar.gz Qt-baba87e49b249b05277bb29af3e54f70fcbb3520.tar.bz2 |
QNAM: Do not cache network connections per username.
If user information is present in the Url, QNetworkAccessHttpBackend
will cache the connection with a key in the format of user@hostname.
This causes the following tests in QtWebKit to fail:
LayoutTests/http/tests/xmlhttprequest/re-login.html
LayoutTests/http/tests/xmlhttprequest/re-login-async.html
The tests call the same url with user1 credentials, no credentials,
user 2 credentials and no credentials. In the second and fourth calls
Qt should use the most recently stored credentials. For the fourth
call it currently uses user1's credentials instead of user2's. This
is because it retrieves the cached connection from the third call
and uses the user/pass in that connection's authenticator - which is
user1's.
In order to retrieve the connection with the most recently used
credentials userinfo should be removed when caching the connection
in QNetworkAccessCache. This will allow Qt to retrieve the connection
used in the third call, in fact the same cached connection for all
four calls.
Merge-request: 623
Reviewed-by: Markus Goetz <Markus.Goetz@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qnetworkaccesshttpbackend.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 1d85f3a..3fb7924 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -72,7 +72,7 @@ static QByteArray makeCacheKey(QNetworkAccessHttpBackend *backend, QNetworkProxy QUrl copy = backend->url(); bool isEncrypted = copy.scheme().toLower() == QLatin1String("https"); copy.setPort(copy.port(isEncrypted ? DefaultHttpsPort : DefaultHttpPort)); - result = copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | + result = copy.toEncoded(QUrl::RemoveUserInfo | QUrl::RemovePath | QUrl::RemoveQuery | QUrl::RemoveFragment); #ifndef QT_NO_NETWORKPROXY |