summaryrefslogtreecommitdiffstats
path: root/tests/auto/qnetworkcookie
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2011-04-27 09:48:53 (GMT)
committerPeter Hartmann <peter.hartmann@nokia.com>2011-04-29 08:15:46 (GMT)
commitc85c1ea36cd9ebe6a9ff970d7ba0ce8d08d5b27b (patch)
treefcb2a06415802263bae5b7a236605c1a660fb045 /tests/auto/qnetworkcookie
parent2fe1f118a791383de68d33a76f72d260f8bda2eb (diff)
downloadQt-c85c1ea36cd9ebe6a9ff970d7ba0ce8d08d5b27b.zip
Qt-c85c1ea36cd9ebe6a9ff970d7ba0ce8d08d5b27b.tar.gz
Qt-c85c1ea36cd9ebe6a9ff970d7ba0ce8d08d5b27b.tar.bz2
QNetworkCookie: allow spaces in unquoted values
We should follow http://tools.ietf.org/html/draft-ietf-httpstate-cookie-23 , which says parse the value until reaching the next ';' or the end of the line. Other cookie implementations allow spaces in unquoted values as well. Reviewed-by: Martin Petersson Task-number: QTBUG-18876
Diffstat (limited to 'tests/auto/qnetworkcookie')
-rw-r--r--tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
index e0c477b..9a58482 100644
--- a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
+++ b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
@@ -182,6 +182,14 @@ void tst_QNetworkCookie::parseSingleCookie_data()
cookie.setValue("\"\\\"a, b; c\\\"\"");
QTest::newRow("with-value-with-special5") << "a = \"\\\"a, b; c\\\"\"" << cookie;
+ cookie.setValue("b c");
+ QTest::newRow("with-value-with-whitespace") << "a = b c" << cookie;
+
+ cookie.setValue("\"b\"");
+ QTest::newRow("quoted-value") << "a = \"b\"" << cookie;
+ cookie.setValue("\"b c\"");
+ QTest::newRow("quoted-value-with-whitespace") << "a = \"b c\"" << cookie;
+
cookie.setValue("b");
cookie.setSecure(true);
QTest::newRow("secure") << "a=b;secure" << cookie;