summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-05-04 15:21:02 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-05-04 15:21:02 (GMT)
commit793d3c2da83098e32063c4ae6df187058103bde8 (patch)
tree7b96581a67bd66ff30b0ede18b0fbfd71d9345cf /src/network
parent2d0f49df3a3c44601bf2e41ea722c2384b71aab0 (diff)
parentc2d47f6717fdccd44838f3c128693a3c09f6cf68 (diff)
downloadQt-793d3c2da83098e32063c4ae6df187058103bde8.zip
Qt-793d3c2da83098e32063c4ae6df187058103bde8.tar.gz
Qt-793d3c2da83098e32063c4ae6df187058103bde8.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into windows-7-multitouch
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkcookie.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 01a743b..aaa5075 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -976,14 +976,14 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin
cookie.setExpirationDate(dt);
} else if (field.first == "domain") {
QByteArray rawDomain = field.second;
- QString maybeLeadingDot;
if (rawDomain.startsWith('.')) {
- maybeLeadingDot = QLatin1Char('.');
rawDomain = rawDomain.mid(1);
}
-
QString normalizedDomain = QUrl::fromAce(QUrl::toAce(QString::fromUtf8(rawDomain)));
- cookie.setDomain(maybeLeadingDot + normalizedDomain);
+ // always add the dot, there are some servers that forget the
+ // leading dot. This is actually forbidden according to RFC 2109,
+ // but all browsers accept it anyway so we do that as well
+ cookie.setDomain(QLatin1Char('.') + normalizedDomain);
} else if (field.first == "max-age") {
bool ok = false;
int secs = field.second.toInt(&ok);
@@ -1184,7 +1184,6 @@ bool QNetworkCookieJar::setCookiesFromUrl(const QList<QNetworkCookie> &cookieLis
cookie.expirationDate() < now;
// validate the cookie & set the defaults if unset
- // (RFC 2965: "The request-URI MUST path-match the Path attribute of the cookie.")
if (cookie.path().isEmpty())
cookie.setPath(defaultPath);
else if (!isParentPath(pathAndFileName, cookie.path()))