Files must be uploaded within repository base path

This commit is contained in:
Melon 2024-03-15 15:29:37 +00:00
parent 3cd41fbfc7
commit 03820c48de
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -103,6 +103,7 @@ func (r *routeCtx) handlePut(rw http.ResponseWriter, req *http.Request, params h
http.Error(rw, "404 Not Found", http.StatusNotFound)
return
}
p = filepath.Join(r.basePath, p)
err = os.MkdirAll(filepath.Dir(p), os.ModePerm)
if err != nil {
http.Error(rw, "500 Failed to create directory", http.StatusInternalServerError)