Skip to content

Commit c03e07a

Browse files
committed
feat(serverHandler): overwrite existing file if upload dir has delete perm
1 parent 58a709f commit c03e07a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/serverHandler/main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,8 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
9090
}
9191

9292
switch {
93-
case data.CanUpload && r.URL.RawQuery == "sync" && r.Method == http.MethodPost:
94-
h.saveUploadFiles(h.root+data.handlerReqPath, data.CanDelete, r)
95-
http.Redirect(w, r, r.URL.Path, http.StatusFound)
96-
return
9793
case data.CanUpload && r.URL.RawQuery == "upload" && r.Method == http.MethodPost:
98-
h.saveUploadFiles(h.root+data.handlerReqPath, false, r)
94+
h.saveUploadFiles(h.root+data.handlerReqPath, data.CanDelete, r)
9995
http.Redirect(w, r, r.URL.Path, http.StatusFound)
10096
return
10197
case data.CanMkdir && strings.HasPrefix(r.URL.RawQuery, "mkdir"):

0 commit comments

Comments
 (0)