Add files page
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user