mirror of
https://github.com/curl/curl.git
synced 2026-08-05 08:26:14 +03:00
urlapi: guess scheme correct even with credentials given
In the "scheme-less" parsing case, we need to strip off credentials first before we guess scheme based on the host name! Assisted-by: Jay Satiro Fixes #4856 Closes #4857
This commit is contained in:
parent
0b030a5b23
commit
d3dc0a07e9
2 changed files with 46 additions and 32 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -129,6 +129,14 @@ struct querycase {
|
|||
};
|
||||
|
||||
static struct testcase get_parts_list[] ={
|
||||
{"user:moo@ftp.example.com/color/#green?no-black",
|
||||
"ftp | user | moo | [13] | ftp.example.com | [15] | /color/ | [16] | "
|
||||
"green?no-black",
|
||||
CURLU_GUESS_SCHEME, 0, CURLUE_OK },
|
||||
{"ftp.user:moo@example.com/color/#green?no-black",
|
||||
"http | ftp.user | moo | [13] | example.com | [15] | /color/ | [16] | "
|
||||
"green?no-black",
|
||||
CURLU_GUESS_SCHEME, 0, CURLUE_OK },
|
||||
#ifdef WIN32
|
||||
{"file:/C:\\programs\\foo",
|
||||
"file | [11] | [12] | [13] | [14] | [15] | C:\\programs\\foo | [16] | [17]",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue