Skip to content

URL parser: userinfo breaks the protocol guessing when no scheme is given #4856

@bagder

Description

@bagder

I did this

curl user:password@ftp.funet.fi

I expected the following

That curl would try to use FTP to the site and use the given name and password for login. Instead it made a HTTP request to the given host.

The reason for this mistake is that the "protocol guessing" is done on the host name part when the credentials are still prepended! This does also make something like curl ftp.user:pwd@example.com (wrongly) guess on FTP based on the user name and not on the host name!

I have extended test 1560 with these two examples and will work on a PR.

curl/libcurl version

latest git

operating system

any

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions