fix: address branch review issues (json tags, share lockout, session expiry, file unlink)

This commit is contained in:
2026-08-26 23:44:19 +08:00
parent b7af194492
commit d988d35881
6 changed files with 67 additions and 17 deletions
+6
View File
@@ -80,9 +80,15 @@ func (s *Server) handleDownload(w http.ResponseWriter, r *http.Request) {
func (s *Server) handleDeleteFile(w http.ResponseWriter, r *http.Request) {
id := r.PathValue("id")
f, err := s.store.FileGet(id)
if err != nil {
http.Error(w, "Not found", http.StatusNotFound)
return
}
if err := s.store.FileDelete(id); err != nil {
http.Error(w, "Failed to delete", http.StatusInternalServerError)
return
}
os.Remove(filepath.Join(s.workspace, f.Dir, f.StorageName))
w.WriteHeader(http.StatusNoContent)
}