mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-18 04:10:51 +08:00
refactor(util, executor): optimize payload handling and schema processing
- Replaced repetitive string operations with a centralized `escapeGJSONPathKey` function. - Streamlined handling of JSON schema cleaning for Gemini and Antigravity requests. - Improved payload management by transitioning from byte slices to strings for processing. - Removed unnecessary cloning of byte slices in several places.
This commit is contained in:
@@ -667,6 +667,9 @@ func orDefault(val, def string) string {
|
||||
}
|
||||
|
||||
func escapeGJSONPathKey(key string) string {
|
||||
if strings.IndexAny(key, ".*?") == -1 {
|
||||
return key
|
||||
}
|
||||
return gjsonPathKeyReplacer.Replace(key)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user