Skip to content

net/url: Parse does not parse username and password correctly #3439

@snaury

Description

@snaury
If you do something like:

u, _ := url.Parse("http://user@gmail.com:password@hostname.com:80/path";)

Then u.User.Username() would be "user" and u.Host would be
"gmail.com:password@hostname.com:80". This is unexpected and contrary to other
languages and frameworks. Instead of splitting on the first "@" in authority,
url.Parse should split on the last.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions