mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-14 18:09:05 +00:00
fix: clean browser dialer path parsing guard
Agent-Logs-Url: https://github.com/XTLS/Xray-core/sessions/3aee4c73-7847-433c-905a-2eafe5b1bfe8 Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4636ca2675
commit
12ecf47fcc
@@ -71,14 +71,11 @@ func parseBrowserDialerAddress(addr string) (string, string, bool) {
|
||||
}
|
||||
|
||||
listenAddr, pathRaw, ok := strings.Cut(addr, "/")
|
||||
if !ok || listenAddr == "" {
|
||||
if !ok || listenAddr == "" || pathRaw == "" {
|
||||
return "", "", false
|
||||
}
|
||||
|
||||
path := "/" + strings.TrimSuffix(pathRaw, "/")
|
||||
if path == "" {
|
||||
return "", "", false
|
||||
}
|
||||
if _, _, err := net.SplitHostPort(listenAddr); err != nil {
|
||||
return "", "", false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user