aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
authorJens Finkhaeuser <jens@finkhaeuser.de>2019-09-19 15:54:53 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-09-19 15:57:28 +0200
commit0a4ecbdf1c35de3a0a367db73edbf50fabc0fb0e (patch)
tree6683941b25029f617b35d5ca9787391680bdb3c9 /tests/libtest
parent346188f6e455ab99f1d040e3ba474b80e9694bda (diff)
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
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/lib1560.c23
1 files changed, 23 insertions, 0 deletions
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}
};