Add files page

This commit is contained in:
2026-09-13 11:28:17 +02:00
parent ab0e1b47d8
commit 30826f3671
7 changed files with 247 additions and 81 deletions
+5 -5
View File
@@ -58,11 +58,11 @@ func (s *Server) handleDelete(w http.ResponseWriter, r *http.Request) {
writeJSON(w, http.StatusOK, map[string]string{"status": "deleted", "id": id})
return
}
// Deleting from the administration table goes back to it. The destination
// is built from configuration, never from the request, so this cannot be
// turned into an open redirect.
if from == "admin" {
http.Redirect(w, r, s.cfg.BasePath+"admin", http.StatusSeeOther)
// Deleting from the listing goes back to it. The destination is built from
// configuration, never from the request, so this cannot be turned into an
// open redirect.
if from == "files" {
http.Redirect(w, r, s.cfg.BasePath+"files", http.StatusSeeOther)
return
}
s.render(w, http.StatusOK, "error.html", errorPage{