summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorRobert Hogan <robert@webkit.org>2010-04-27 20:22:19 (GMT)
committerSamuli Piippo <samuli.piippo@digia.com>2011-06-09 10:05:48 (GMT)
commitdcdcc1e16187a05049b3f5bfcb667049d340f113 (patch)
tree5e5fdf1e286e660aadab6d4854b1248d3dda5264 /tests/auto
parentb775df59b34cdf53e5bc9a7e6108533f443fe8b4 (diff)
downloadQt-dcdcc1e16187a05049b3f5bfcb667049d340f113.zip
Qt-dcdcc1e16187a05049b3f5bfcb667049d340f113.tar.gz
Qt-dcdcc1e16187a05049b3f5bfcb667049d340f113.tar.bz2
Secure Cookies should only be sent over secure connections.
http://bugreports.qt.nokia.com/browse/QTBUG-9618 QtWebKit currently fails the following test: LayoutTests/http/tests/xmlhttprequest/cookies.html This is because QNetworkCookieJar::cookiesForUrl returns secure cookies even when the connection is not secure. A 'secure' cookie is set by response headers from a http server as follows: 'Set-Cookie: cookie-name=value; secure' Correct QNetworkCookieJar::cookiesForUrl to ignore secure cookies when the url in the request is not 'https:'. Task-number: QTBUG-9618 Merge-request: 2372 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> (cherry picked from commit 483fdd017d9998c6d7f4a035ca615e15fbc97e6a)
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
index 9751fe9..889defe 100644
--- a/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
+++ b/tests/auto/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
@@ -304,6 +304,18 @@ void tst_QNetworkCookieJar::cookiesForUrl_data()
QTest::newRow("path-match-2") << allCookies << "http://nokia.com/web/" << result;
QTest::newRow("path-match-3") << allCookies << "http://nokia.com/web/content" << result;
+ // secure cookies
+ allCookies.clear();
+ result.clear();
+ QNetworkCookie secureCookie;
+ secureCookie.setName("a");
+ secureCookie.setPath("/web");
+ secureCookie.setDomain(".nokia.com");
+ secureCookie.setSecure(true);
+ allCookies += secureCookie;
+ QTest::newRow("no-match-secure-1") << allCookies << "http://nokia.com/web" << result;
+ QTest::newRow("no-match-secure-2") << allCookies << "http://qt.nokia.com/web" << result;
+
}
void tst_QNetworkCookieJar::cookiesForUrl()