diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-09-10 16:39:43 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-09-16 17:05:09 +0200 |
commit | 6cee284001adf9da42b347a074cbff3cb92621b2 (patch) | |
tree | c46b5fe486454cb632bef5173270dfffc4d57ee7 /tests/auto/corelib/io/qurl | |
parent | da3c2cc6a8a5733df61d11e712a5d5a3574960ca (diff) |
Fix mis-handling of actual TLD in qIsEffectiveTLD()
If the domain passed down is an actual TLD that's the subject of a *
rule, e.g. "ck" subject to *.ck, then we were finding no dot in it and
concluding that it couldn't be the subject of a * rule.
Added a test for the specific .ck case and commented on where we could
get some canonical test data that I tripped over while researching
this. Cross-reference the cookie-jar test from the QUrl test, too.
Fixes: QTBUG-78097
Change-Id: Id858a9dae22e6b306a68df3fc199e0160f537159
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/qurl')
-rw-r--r-- | tests/auto/corelib/io/qurl/tst_qurl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 3123c42326..ef4325d2ea 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -3389,8 +3389,15 @@ void tst_QUrl::acceptEmptyAuthoritySegments() void tst_QUrl::effectiveTLDs_data() { + // See also: tst_QNetworkCookieJar::setCookiesFromUrl(). + // in tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp QTest::addColumn<QUrl>("domain"); QTest::addColumn<QString>("TLD"); + // TODO: autogenerate test-cases from: + // https://raw.githubusercontent.com/publicsuffix/list/master/tests/test_psl.txt + // checkPublicSuffix(domain, tail) appears in the list if + // either tail is null and domain is public or + // tail is the "registrable" part of domain; i.e. its minimal non-public tail. QTest::newRow("yes0") << QUrl::fromEncoded("http://test.co.uk") << ".co.uk"; QTest::newRow("yes1") << QUrl::fromEncoded("http://test.com") << ".com"; |