From 1f4810fde9f4e2f3f0921ea1e57f44f5f823b383 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Aug 2009 20:15:54 +0200 Subject: 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. --- src/network/access/qnetworkcookie.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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="; -- cgit v0.12