summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkcookiejar.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-11-12 05:34:21 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-11-12 05:34:21 (GMT)
commit05c1b075f757afcc87748ac6758277eb5c0d8e17 (patch)
tree9f3159998e643ccd96313c94fb5eac2782aa3aab /src/network/access/qnetworkcookiejar.cpp
parent87845845cd5b44bc4ad391ad5ae8499f3850acb3 (diff)
parentdb3ae6188c8f88f25b4f8e2645e76a7c6fffef18 (diff)
downloadQt-05c1b075f757afcc87748ac6758277eb5c0d8e17.zip
Qt-05c1b075f757afcc87748ac6758277eb5c0d8e17.tar.gz
Qt-05c1b075f757afcc87748ac6758277eb5c0d8e17.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/network/access/qnetworkcookiejar.cpp')
-rw-r--r--src/network/access/qnetworkcookiejar.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/access/qnetworkcookiejar.cpp b/src/network/access/qnetworkcookiejar.cpp
index 8430966..19f7217 100644
--- a/src/network/access/qnetworkcookiejar.cpp
+++ b/src/network/access/qnetworkcookiejar.cpp
@@ -198,6 +198,13 @@ bool QNetworkCookieJar::setCookiesFromUrl(const QList<QNetworkCookie> &cookieLis
if (cookie.domain().isEmpty()) {
cookie.setDomain(defaultDomain);
} else {
+ // Ensure the domain starts with a dot if its field was not empty
+ // in the HTTP header. There are some servers that forget the
+ // leading dot and this is actually forbidden according to RFC 2109,
+ // but all browsers accept it anyway so we do that as well.
+ if (!cookie.domain().startsWith(QLatin1Char('.')))
+ cookie.setDomain(QLatin1Char('.') + cookie.domain());
+
QString domain = cookie.domain();
if (!(isParentDomain(domain, defaultDomain)
|| isParentDomain(defaultDomain, domain))) {