summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-08-18 18:15:54 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-08-18 18:18:44 (GMT)
commit1f4810fde9f4e2f3f0921ea1e57f44f5f823b383 (patch)
tree8fd7d92463da3d975a479a69be41cc7c61409002 /src/network/access
parenta1f2275772ba4ad8db0670ec6b41f99d9c2384f3 (diff)
downloadQt-1f4810fde9f4e2f3f0921ea1e57f44f5f823b383.zip
Qt-1f4810fde9f4e2f3f0921ea1e57f44f5f823b383.tar.gz
Qt-1f4810fde9f4e2f3f0921ea1e57f44f5f823b383.tar.bz2
Fixed toRawForm because the domains usually start with a dot.
Like 9fea895d6, the series of commits ending in ff1280178 made QUrl::toAce more strict. Now it doesn't accept empty domain labels, which is exactly what a leading dot means. Interestingly, KDE 3's KURL had a long-standing hack to support the leading dot and which I broke on more than one occasion. And it had that feature exactly because of cookies.
Diffstat (limited to 'src/network/access')
-rw-r--r--src/network/access/qnetworkcookie.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 0c13286..6884bee 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -504,7 +504,12 @@ QByteArray QNetworkCookie::toRawForm(RawForm form) const
}
if (!d->domain.isEmpty()) {
result += "; domain=";
- result += QUrl::toAce(d->domain);
+ QString domainNoDot = d->domain;
+ if (domainNoDot.startsWith(QLatin1Char('.'))) {
+ result += '.';
+ domainNoDot = domainNoDot.mid(1);
+ }
+ result += QUrl::toAce(domainNoDot);
}
if (!d->path.isEmpty()) {
result += "; path=";