summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Kearns <ext-shane.2.kearns@nokia.com>2012-06-08 17:49:54 +0100
committerQt by Nokia <qt-info@nokia.com>2012-06-27 00:46:35 +0200
commit3ff70a838b5dd06cd55e17e1e55d5922e5155745 (patch)
tree95ed26be0a4f8e3f4e0759a76958931781f05c20
parentcf29b7b967e59f08713d6574b754874a900bf6cd (diff)
QNetworkCookie - ignore unparsable expires attribute
As required by RFC6265, if the date can't be parsed then the attribute should be ignored but not the whole cookie. Task-number: QTBUG-15794 Task-number: QTBUG-16798 Change-Id: I2ed2fbbaf2d00b194995349c24b174032a599703 Reviewed-by: Richard J. Moore <rich@kde.org>
-rw-r--r--src/network/access/qnetworkcookie.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index 1dd1e25b07..1fdf798dc6 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -925,10 +925,9 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt
QByteArray dateString = cookieString.mid(position, end - position).trimmed();
position = end;
QDateTime dt = parseDateString(dateString.toLower());
- if (!dt.isValid()) {
- return result;
- }
- cookie.setExpirationDate(dt);
+ if (dt.isValid())
+ cookie.setExpirationDate(dt);
+ //if unparsed, ignore the attribute but not the whole cookie (RFC6265 section 5.2.1)
} else if (field.first == "domain") {
QByteArray rawDomain = field.second;
//empty domain should be ignored (RFC6265 section 5.2.3)