From d3dc0a07e9bd11afaac026802a9701f0796de780 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 27 Jan 2020 17:28:40 +0100 Subject: 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 --- tests/libtest/lib1560.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tests/libtest') diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index 7f8accc7d..6228a137b 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, , 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]", -- cgit v1.2.3