diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-05-04 16:27:36 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-05-05 13:01:24 (GMT) |
commit | cffec6c4fc1aed32ec9b3d9dd1f97105005385dc (patch) | |
tree | 5ccc8214e5674963e073084196141d65072886c5 /src/network/ssl | |
parent | e8fc93973a41f193665baa5fdc26cba951bd692f (diff) | |
download | Qt-cffec6c4fc1aed32ec9b3d9dd1f97105005385dc.zip Qt-cffec6c4fc1aed32ec9b3d9dd1f97105005385dc.tar.gz Qt-cffec6c4fc1aed32ec9b3d9dd1f97105005385dc.tar.bz2 |
Send User-Agent from the network request in http proxy CONNECT command
Some proxies can discriminate based on the User-Agent when sent a
CONNECT command for establishing a HTTPS connection.
With this change, if the User-Agent header is set in the QNetworkRequest
then it will be passed to the http socket engine for use in the connect
command sent to the proxy.
As before, "Mozilla/5.0" will be used by default when no user agent
has been set.
Task-number: QTBUG-17223
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/ssl')
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 4252123..cf95adf 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1698,6 +1698,8 @@ void QSslSocket::connectToHostImplementation(const QString &hostName, quint16 po } #ifndef QT_NO_NETWORKPROXY d->plainSocket->setProxy(proxy()); + //copy user agent down to the plain socket (if it has been set) + d->plainSocket->setProperty("_q_user-agent", property("_q_user-agent")); #endif QIODevice::open(openMode); d->plainSocket->connectToHost(hostName, port, openMode); |