From: Daniel Stenberg Date: Wed, 14 Sep 2022 07:21:49 +0000 (+0200) Subject: lib1560: extended to verify detect/reject of unknown schemes X-Git-Tag: curl-7_86_0~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c4768f168c0cb34cd947af82f561613d31034f45;p=thirdparty%2Fcurl.git lib1560: extended to verify detect/reject of unknown schemes ... when no guessing is allowed. --- diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index 891c4701a3..c38b3131bb 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -248,7 +248,7 @@ static const struct testcase get_parts_list[] ={ CURLU_DEFAULT_SCHEME, 0, CURLUE_NO_HOST}, {"boing:80", "https | [11] | [12] | [13] | boing | 80 | / | [16] | [17]", - CURLU_DEFAULT_SCHEME, 0, CURLUE_OK}, + CURLU_DEFAULT_SCHEME|CURLU_GUESS_SCHEME, 0, CURLUE_OK}, {"http://[fd00:a41::50]:8080", "http | [11] | [12] | [13] | [fd00:a41::50] | 8080 | / | [16] | [17]", CURLU_DEFAULT_SCHEME, 0, CURLUE_OK}, @@ -393,6 +393,15 @@ static const struct testcase get_parts_list[] ={ }; static const struct urltestcase get_url_list[] = { + /* unsupported schemes with no guessing enabled */ + {"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIEhUTUw+PG1ldGEgY", + "", 0, 0, CURLUE_UNSUPPORTED_SCHEME}, + {"d:anything-really", "", 0, 0, CURLUE_UNSUPPORTED_SCHEME}, + {"about:config", "", 0, 0, CURLUE_UNSUPPORTED_SCHEME}, + {"example://foo", "", 0, 0, CURLUE_UNSUPPORTED_SCHEME}, + {"mailto:infobot@example.com?body=send%20current-issue", "", 0, 0, + CURLUE_UNSUPPORTED_SCHEME}, + {"about:80", "https://about:80/", CURLU_DEFAULT_SCHEME, 0, CURLUE_OK}, /* percent encoded host names */ {"http://example.com%40127.0.0.1/", "", 0, 0, CURLUE_BAD_HOSTNAME}, {"http://example.com%21127.0.0.1/", "", 0, 0, CURLUE_BAD_HOSTNAME},