From 03820c48de55c75c9e8095ec3b4b20ebe9883cd0 Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Fri, 15 Mar 2024 15:29:37 +0000 Subject: [PATCH] Files must be uploaded within repository base path --- routes/router.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/router.go b/routes/router.go index 027a703..de20b58 100644 --- a/routes/router.go +++ b/routes/router.go @@ -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)