fix: uncontrolled data used in path expression

This commit is contained in:
Jacky 2024-07-30 14:40:52 +08:00
parent 226827f21e
commit 013d810678
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
7 changed files with 24 additions and 7 deletions

View file

@ -47,7 +47,7 @@ func EditConfig(c *gin.Context) {
return
}
if _, err := os.Stat(path); os.IsNotExist(err) {
if !helper.FileExists(path) {
c.JSON(http.StatusNotFound, gin.H{
"message": "file not found",
})