diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-26 22:37:29 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-26 22:37:29 (GMT) |
commit | e4026fee42b584c59db3f9f6d5acd2b4a08324d0 (patch) | |
tree | 1ffe768101ee9c361caf8fbc805e24f84a09e94f /src/network/access | |
parent | 0c893d56d449e49d5cc84dcb2dfc4e261f08172e (diff) | |
parent | 72c31196fdba0cd297ed42cb35959b4b305296c7 (diff) | |
download | Qt-e4026fee42b584c59db3f9f6d5acd2b4a08324d0.zip Qt-e4026fee42b584c59db3f9f6d5acd2b4a08324d0.tar.gz Qt-e4026fee42b584c59db3f9f6d5acd2b4a08324d0.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
skip the ipv6 Host checking for the moment, since it fails on Windows XP. will fix later
remove duplicate message
fix "Host" header of ipv6 URLs in QNAM
uic: Use QString::fromUtf8 for QUrl properties.
uic: #include <QLayout> for QToolBox on non-laid-out forms.
add test case for ipv6 url parsing
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 33124fd..6101eea 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -261,7 +261,17 @@ void QHttpNetworkConnectionPrivate::prepareRequest(HttpMessagePair &messagePair) // set the host value = request.headerField("host"); if (value.isEmpty()) { - QByteArray host = QUrl::toAce(hostName); + QHostAddress add; + QByteArray host; + if(add.setAddress(hostName)) { + if(add.protocol() == QAbstractSocket::IPv6Protocol) { + host = "[" + hostName.toAscii() + "]";//format the ipv6 in the standard way + } else { + host = QUrl::toAce(hostName); + } + } else { + host = QUrl::toAce(hostName); + } int port = request.url().port(); if (port != -1) { |