mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-28 19:20:25 +08:00
修复合并URL中多余分隔符时导致参数发生变化的Bug
This commit is contained in:
@@ -9,6 +9,10 @@ func CleanPath(path string) string {
|
||||
result := []byte{'/'}
|
||||
isSlash := true
|
||||
for i := 0; i < l; i++ {
|
||||
if path[i] == '?' {
|
||||
result = append(result, path[i:]...)
|
||||
break
|
||||
}
|
||||
if path[i] == '\\' || path[i] == '/' {
|
||||
if !isSlash {
|
||||
isSlash = true
|
||||
@@ -21,4 +25,3 @@ func CleanPath(path string) string {
|
||||
}
|
||||
return string(result)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user