From 0a4ecbdf1c35de3a0a367db73edbf50fabc0fb0e Mon Sep 17 00:00:00 2001 From: Jens Finkhaeuser Date: Thu, 19 Sep 2019 15:54:53 +0200 Subject: urlapi: CURLU_NO_AUTHORITY allows empty authority/host part CURLU_NO_AUTHORITY is intended for use with unknown schemes (i.e. not "file:///") to override cURL's default demand that an authority exists. Closes #4349 --- tests/libtest/lib1560.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/libtest') diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index 85884474e..d161423e3 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -414,6 +414,18 @@ static struct urltestcase get_url_list[] = { {"tp://example.com/path/html", "tp://example.com/path/html", CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK}, + {"custom-scheme://host?expected=test-good", + "custom-scheme://host/?expected=test-good", + CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK}, + {"custom-scheme://?expected=test-bad", + "", + CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_MALFORMED_INPUT}, + {"custom-scheme://?expected=test-new-good", + "custom-scheme:///?expected=test-new-good", + CURLU_NON_SUPPORT_SCHEME | CURLU_NO_AUTHORITY, 0, CURLUE_OK}, + {"custom-scheme://host?expected=test-still-good", + "custom-scheme://host/?expected=test-still-good", + CURLU_NON_SUPPORT_SCHEME | CURLU_NO_AUTHORITY, 0, CURLUE_OK}, {NULL, NULL, 0, 0, 0} }; @@ -551,6 +563,17 @@ static struct setcase set_parts_list[] = { "scheme=ftp,", "ftp://example.com:80/", 0, 0, CURLUE_OK, CURLUE_OK}, + {"custom-scheme://host", + "host=\"\",", + "custom-scheme://host/", + CURLU_NON_SUPPORT_SCHEME, CURLU_NON_SUPPORT_SCHEME, CURLUE_OK, + CURLUE_MALFORMED_INPUT}, + {"custom-scheme://host", + "host=\"\",", + "custom-scheme:///", + CURLU_NON_SUPPORT_SCHEME, CURLU_NON_SUPPORT_SCHEME | CURLU_NO_AUTHORITY, + CURLUE_OK, CURLUE_OK}, + {NULL, NULL, NULL, 0, 0, 0, 0} }; -- cgit v1.2.3