mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-08 14:13:22 +00:00
refactor: simplify browser dialer parsed path normalization
Agent-Logs-Url: https://github.com/XTLS/Xray-core/sessions/56a85a3a-5e08-44ce-97d9-d441379c11cc Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e79f3a4361
commit
7416fd225e
@@ -149,7 +149,10 @@ func parseBrowserDialerAddress(addr string) (string, string, bool) {
|
||||
if _, _, err := net.SplitHostPort(listenAddr); err != nil {
|
||||
return "", "", false
|
||||
}
|
||||
path := "/" + strings.Trim(strings.TrimSuffix(parsedAddr.Path, "/"), "/")
|
||||
path := strings.TrimSuffix(parsedAddr.Path, "/")
|
||||
if !strings.HasPrefix(path, "/") {
|
||||
path = "/" + path
|
||||
}
|
||||
cleanPath := pathlib.Clean(path)
|
||||
if cleanPath == "." || cleanPath == "/" || cleanPath != path {
|
||||
return "", "", false
|
||||
|
||||
Reference in New Issue
Block a user