summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-05-25 16:48:56 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-05-25 16:48:56 (GMT)
commit3ef4ab3085f45911e3a38c1b6585425b9c61a3f4 (patch)
tree5915a9b77bdd4db46fca70f0142e3ce3d51853ad /src
parentdf3691a0709af1706375772f5b68b0862ffb2d58 (diff)
parent1013cf05d579dbcf61890b5529a6e970aa562a19 (diff)
downloadQt-3ef4ab3085f45911e3a38c1b6585425b9c61a3f4.zip
Qt-3ef4ab3085f45911e3a38c1b6585425b9c61a3f4.tar.gz
Qt-3ef4ab3085f45911e3a38c1b6585425b9c61a3f4.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: fix the "Host" header for ipv6 URLs in QNAM
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 61230fc..d76a5fd 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -256,7 +256,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) {