diff options
Diffstat (limited to 'libgo/go/net/url/url.go')
-rw-r--r-- | libgo/go/net/url/url.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libgo/go/net/url/url.go b/libgo/go/net/url/url.go index b6e79ad..17bf0d3 100644 --- a/libgo/go/net/url/url.go +++ b/libgo/go/net/url/url.go @@ -401,11 +401,12 @@ Error: } func parseAuthority(authority string) (user *Userinfo, host string, err error) { - if strings.Index(authority, "@") < 0 { + i := strings.LastIndex(authority, "@") + if i < 0 { host = authority return } - userinfo, host := split(authority, '@', true) + userinfo, host := authority[:i], authority[i+1:] if strings.Index(userinfo, ":") < 0 { if userinfo, err = unescape(userinfo, encodeUserPassword); err != nil { return |