chore: forbid rename key in cluster mode

This commit is contained in:
tiny-craft
2023-10-15 22:38:41 +08:00
parent 78bac6078a
commit 4a0807e463
3 changed files with 10 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ import (
"strconv"
"strings"
"tinyrdm/backend/types"
"unicode/utf8"
)
// ConvertTo convert string to specified type
@@ -187,7 +188,9 @@ func decodeJson(str string) (string, bool) {
func decodeBase64(str string) (string, bool) {
if decodedStr, err := base64.StdEncoding.DecodeString(str); err == nil {
return string(decodedStr), true
if s := string(decodedStr); utf8.ValidString(s) {
return s, true
}
}
return str, false
}