summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpthreaddelegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/access/qhttpthreaddelegate.cpp')
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index 4e1d24280b..522f8d9891 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -328,6 +328,16 @@ void QHttpThreadDelegate::startRequest()
// cache the QHttpNetworkConnection corresponding to this cache key
connections.localData()->addEntry(cacheKey, httpConnection);
+ } else {
+ if (httpRequest.withCredentials()) {
+ QNetworkAuthenticationCredential credential = authenticationManager->fetchCachedCredentials(httpRequest.url(), 0);
+ if (!credential.user.isEmpty() && !credential.password.isEmpty()) {
+ QAuthenticator auth;
+ auth.setUser(credential.user);
+ auth.setPassword(credential.password);
+ httpConnection->d_func()->copyCredentials(-1, &auth, false);
+ }
+ }
}