diff options
author | Robert Hogan <robert@webkit.org> | 2010-11-01 11:44:47 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-11-01 11:45:00 (GMT) |
commit | fdcb3fe188cca00b1d7f1eae82304d8cca549996 (patch) | |
tree | b64eada1415cb7d10e3672c1d5fc414b191a73bd /src/network | |
parent | c7221d3ce40f07ce702d732b72978de315b6b194 (diff) | |
download | Qt-fdcb3fe188cca00b1d7f1eae82304d8cca549996.zip Qt-fdcb3fe188cca00b1d7f1eae82304d8cca549996.tar.gz Qt-fdcb3fe188cca00b1d7f1eae82304d8cca549996.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/network')
-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 afbb706..c02f30e2 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -71,7 +71,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 |