diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-09 16:14:20 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-11-09 16:14:20 (GMT) |
commit | a8e0e5656f09130e68c10209429a0870b38248c4 (patch) | |
tree | 9f2c51be485c3f1e4afea821ebbe838a08c0ce2d /src/network/access | |
parent | 8fbdbd25015a4e5544dace3a77427861f0ca89f4 (diff) | |
parent | b770abdd564f28a8d9dde816f72f73e6b15984af (diff) | |
download | Qt-a8e0e5656f09130e68c10209429a0870b38248c4.zip Qt-a8e0e5656f09130e68c10209429a0870b38248c4.tar.gz Qt-a8e0e5656f09130e68c10209429a0870b38248c4.tar.bz2 |
Merge branch '4.6' into core-4.6
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qnetworkaccessdebugpipebackend.cpp | 4 | ||||
-rw-r--r-- | src/network/access/qnetworkcookie.cpp | 8 | ||||
-rw-r--r-- | src/network/access/qnetworkcookiejar.cpp | 7 |
3 files changed, 13 insertions, 6 deletions
diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp index b4af5b6..fecbe83 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend.cpp +++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp @@ -229,7 +229,7 @@ void QNetworkAccessDebugPipeBackend::possiblyFinish() void QNetworkAccessDebugPipeBackend::closeDownstreamChannel() { - qWarning() << "QNetworkAccessDebugPipeBackend::closeDownstreamChannel()" << operation(); + qWarning("QNetworkAccessDebugPipeBackend::closeDownstreamChannel() %d",operation());; //if (operation() == QNetworkAccessManager::GetOperation) // socket.disconnectFromHost(); } @@ -237,7 +237,7 @@ void QNetworkAccessDebugPipeBackend::closeDownstreamChannel() void QNetworkAccessDebugPipeBackend::socketError() { - qWarning() << "QNetworkAccessDebugPipeBackend::socketError()" << socket.error(); + qWarning("QNetworkAccessDebugPipeBackend::socketError() %d",socket.error()); QNetworkReply::NetworkError code; switch (socket.error()) { case QAbstractSocket::RemoteHostClosedError: diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 73a8703..7dfb7af 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -984,14 +984,14 @@ QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByt 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))); - // 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); + cookie.setDomain(maybeLeadingDot + normalizedDomain); } else if (field.first == "max-age") { bool ok = false; int secs = field.second.toInt(&ok); 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))) { |