equal
deleted
inserted
replaced
982 return result; |
982 return result; |
983 } |
983 } |
984 cookie.setExpirationDate(dt); |
984 cookie.setExpirationDate(dt); |
985 } else if (field.first == "domain") { |
985 } else if (field.first == "domain") { |
986 QByteArray rawDomain = field.second; |
986 QByteArray rawDomain = field.second; |
|
987 QString maybeLeadingDot; |
987 if (rawDomain.startsWith('.')) { |
988 if (rawDomain.startsWith('.')) { |
|
989 maybeLeadingDot = QLatin1Char('.'); |
988 rawDomain = rawDomain.mid(1); |
990 rawDomain = rawDomain.mid(1); |
989 } |
991 } |
|
992 |
990 QString normalizedDomain = QUrl::fromAce(QUrl::toAce(QString::fromUtf8(rawDomain))); |
993 QString normalizedDomain = QUrl::fromAce(QUrl::toAce(QString::fromUtf8(rawDomain))); |
991 // always add the dot, there are some servers that forget the |
994 cookie.setDomain(maybeLeadingDot + normalizedDomain); |
992 // leading dot. This is actually forbidden according to RFC 2109, |
|
993 // but all browsers accept it anyway so we do that as well |
|
994 cookie.setDomain(QLatin1Char('.') + normalizedDomain); |
|
995 } else if (field.first == "max-age") { |
995 } else if (field.first == "max-age") { |
996 bool ok = false; |
996 bool ok = false; |
997 int secs = field.second.toInt(&ok); |
997 int secs = field.second.toInt(&ok); |
998 if (!ok) |
998 if (!ok) |
999 return result; |
999 return result; |