mirror of
https://github.com/1f349/gomvn.git
synced 2024-12-21 23:44:07 +00:00
Files must be uploaded within repository base path
This commit is contained in:
parent
3cd41fbfc7
commit
03820c48de
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user