mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:23:32 +03:00
urlapi: fix redirect from file:// with query, and simplify
- fix redirect from file:// URL with query part - find_host_sep() simplify - urlencode_str() simplify - redirect_url() simplify - made more const char * - add more redirect URL test cases to test 1560 Closes #16498
This commit is contained in:
parent
c028a243f2
commit
bc24c60512
3 changed files with 97 additions and 106 deletions
|
|
@ -1143,6 +1143,25 @@ static CURLUcode updateurl(CURLU *u, const char *cmd, unsigned int setflags)
|
|||
}
|
||||
|
||||
static const struct redircase set_url_list[] = {
|
||||
{"http://firstplace.example.com/want/1314",
|
||||
"//somewhere.example.com/reply/1314",
|
||||
"http://somewhere.example.com/reply/1314",
|
||||
0, 0, CURLUE_OK },
|
||||
{"http://127.0.0.1:46383/want?uri=http://anything/276?secondq/276",
|
||||
"data/2760002.txt?coolsite=http://anotherurl/?a_second/2760002",
|
||||
"http://127.0.0.1:46383/"
|
||||
"data/2760002.txt?coolsite=http://anotherurl/?a_second/2760002",
|
||||
0, 0, CURLUE_OK },
|
||||
{"file:///basic#", "#yay",
|
||||
"file:///basic#yay", 0, 0, CURLUE_OK},
|
||||
{"file:///basic", "?yay",
|
||||
"file:///basic?yay", 0, 0, CURLUE_OK},
|
||||
{"file:///basic?", "?yay",
|
||||
"file:///basic?yay", 0, 0, CURLUE_OK},
|
||||
{"file:///basic?hello", "#frag",
|
||||
"file:///basic?hello#frag", 0, 0, CURLUE_OK},
|
||||
{"file:///basic?hello", "?q",
|
||||
"file:///basic?q", 0, 0, CURLUE_OK},
|
||||
{"http://example.org#withs/ash", "/moo#frag",
|
||||
"http://example.org/moo#frag",
|
||||
0, 0, CURLUE_OK},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue