fix cutHost with auth info
This commit is contained in:
parent
59b99a5b44
commit
f2e32080e4
@ -330,7 +330,12 @@ func cutHost(s string) (host, remain string) {
|
|||||||
} else {
|
} else {
|
||||||
end += start
|
end += start
|
||||||
}
|
}
|
||||||
|
// auth info
|
||||||
|
if n = strings.LastIndexByte(s[start:end], '@'); n >= 0 {
|
||||||
|
start += (n + 1)
|
||||||
|
}
|
||||||
host = s[start:end]
|
host = s[start:end]
|
||||||
|
|
||||||
remain = s[:start] + s[end:]
|
remain = s[:start] + s[end:]
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user