Skip to content

Commit

Permalink
fuck codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
uubulb committed Dec 31, 2024
1 parent 370e71a commit 123f890
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/dashboard/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (w *ginCustomWriter) WriteHeader(code int) {
}

func fileWithCustomStatusCode(c *gin.Context, filepath string, customCode int) {
http.ServeFile(newCustomWriter(c, customCode), c.Request, filepath)
http.ServeFile(newCustomWriter(c, customCode), c.Request, path.Clean(filepath))
}

func fallbackToFrontend(frontendDist fs.FS) func(*gin.Context) {
Expand Down Expand Up @@ -344,7 +344,7 @@ func fallbackToFrontend(frontendDist fs.FS) func(*gin.Context) {
}
return
}
localFilePath := path.Join(singleton.Conf.UserTemplate, c.Request.URL.Path)
localFilePath := path.Join(singleton.Conf.UserTemplate, path.Clean(c.Request.URL.Path))
if checkLocalFileOrFs(c, frontendDist, localFilePath, http.StatusOK) {
return
}
Expand Down

0 comments on commit 123f890

Please sign in to comment.