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>
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)