Commit 4dfa80fb authored by hausmann@webkit.org's avatar hausmann@webkit.org

2009-01-06 Simon Hausmann <simon.hausmann@nokia.com>

        Reviewed by Lars Knoll.

        Added support for HTTP-only cookies to the Qt build.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39643 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 148b1714
2009-01-06 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Lars Knoll.
Added support for HTTP-only cookies to the Qt build.
* platform/qt/CookieJarQt.cpp:
(WebCore::setCookies): Don't set HTTP-only cookies through the DOM.
(WebCore::cookies): Don't return HTTP-only cookies to the DOM.
2009-01-05 David Smith <catfish.man@gmail.com>
Reviewed by Oliver Hunt.
......@@ -71,6 +71,13 @@ void setCookies(Document* document, const KURL& url, const KURL& policyURL, cons
return;
QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(QString(value).toAscii());
QList<QNetworkCookie>::Iterator it = cookies.begin();
while (it != cookies.end()) {
if (it->isHttpOnly())
it = cookies.erase(it);
else
++it;
}
jar->setCookiesFromUrl(cookies, p);
#else
QCookieJar::cookieJar()->setCookies(u, p, (QString)value);
......@@ -90,9 +97,12 @@ String cookies(const Document* document, const KURL& url)
return String();
QStringList resultCookies;
foreach (QNetworkCookie networkCookie, cookies)
foreach (QNetworkCookie networkCookie, cookies) {
if (networkCookie.isHttpOnly())
continue;
resultCookies.append(QString::fromAscii(
networkCookie.toRawForm(QNetworkCookie::NameAndValueOnly).constData()));
}
return resultCookies.join(QLatin1String("; "));
#else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment