fix cutHost with auth info

This commit is contained in:
ginuerzh 2024-07-10 22:16:47 +08:00
parent 59b99a5b44
commit f2e32080e4

View File

@ -330,7 +330,12 @@ func cutHost(s string) (host, remain string) {
} else {
end += start
}
// auth info
if n = strings.LastIndexByte(s[start:end], '@'); n >= 0 {
start += (n + 1)
}
host = s[start:end]
remain = s[:start] + s[end:]
return