fix(utf8): закрыть lossy-границы конфигурации и API

This commit is contained in:
2026-09-07 17:25:27 +05:00
parent ab788725cf
commit af9f476658
38 changed files with 759 additions and 159 deletions
+4
View File
@@ -189,6 +189,10 @@ func ImportPeer(c *gin.Context) {
vo.Fail("the file is too big", c)
return
}
if err = validateStrictJSONEncoding(content); err != nil {
vo.Fail("content contains invalid UTF-8 or UTF-16", c)
return
}
var peerExports []bo.PeerExport
decoder := json.NewDecoder(bytes.NewReader(content))