mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-02 20:40:52 +08:00
Update internal/util/translator.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -33,9 +33,8 @@ func Walk(value gjson.Result, path, field string, paths *[]string) {
|
||||
// . -> \.
|
||||
// * -> \*
|
||||
// ? -> \?
|
||||
safeKey := strings.ReplaceAll(key.String(), ".", "\\.")
|
||||
safeKey = strings.ReplaceAll(safeKey, "*", "\\*")
|
||||
safeKey = strings.ReplaceAll(safeKey, "?", "\\?")
|
||||
var keyReplacer = strings.NewReplacer(".", "\\.", "*", "\\*", "?", "\\?")
|
||||
safeKey := keyReplacer.Replace(key.String())
|
||||
|
||||
if path == "" {
|
||||
childPath = safeKey
|
||||
|
||||
Reference in New Issue
Block a user