summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2009-10-06 09:31:50 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-10-06 09:50:15 (GMT)
commit8c4eb2b62983ec09bdfb2bde2723df12ac4e00ef (patch)
tree894b5acdd9843eac0d6992ba5888eb0a7c656323
parent914cae63fd9045b8ac5877a974551f29eec24d72 (diff)
downloadQt-8c4eb2b62983ec09bdfb2bde2723df12ac4e00ef.zip
Qt-8c4eb2b62983ec09bdfb2bde2723df12ac4e00ef.tar.gz
Qt-8c4eb2b62983ec09bdfb2bde2723df12ac4e00ef.tar.bz2
Fix regression in QUrl: IPv6 hosts should be lowercased like in Qt-4.5.
Merge-Request: 1709 Reviewed-By: Thiago Macieira <thiago.macieira@nokia.com>
-rw-r--r--src/corelib/io/qurl.cpp2
-rw-r--r--tests/auto/qurl/tst_qurl.cpp3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index c6bb893..22d0019 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -3384,6 +3384,8 @@ QString QUrlPrivate::canonicalHost() const
const char *ptr = ba.constData();
if (!_IPLiteral(&ptr))
that->host.clear();
+ else
+ that->host = host.toLower();
} else {
that->host = qt_ACE_do(host, NormalizeAce);
}
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index 413d9d4..8856792 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -2262,6 +2262,9 @@ void tst_QUrl::ipv6_2_data()
QTest::newRow("[::ffff:129.144.52.38]")
<< QString("http://[::ffff:129.144.52.38]/cgi/test.cgi")
<< QString("http://[::ffff:129.144.52.38]/cgi/test.cgi");
+ QTest::newRow("[::FFFF:129.144.52.38]")
+ << QString("http://[::FFFF:129.144.52.38]/cgi/test.cgi")
+ << QString("http://[::ffff:129.144.52.38]/cgi/test.cgi");
}
void tst_QUrl::ipv6_2()