- added form list
- added sort by time
- fixed hanging channel in zip writer
- removed download url from form template
- added upload description
- added linter to Makefiles
- added missing test file
This commit is contained in:
2023-03-29 19:04:01 +02:00
parent c6f2b3f57c
commit 4aac69d425
16 changed files with 142 additions and 30 deletions

View File

@@ -180,6 +180,8 @@ func ZipDir(directory, zipfilename string) error {
if err != nil {
failure <- "Failed to zip directory: " + err.Error()
} else {
close(failure)
}
}()

View File

@@ -73,6 +73,15 @@ func FormCreate(c *fiber.Ctx, cfg *cfg.Config, db *Db) error {
entry.Notify = nt
}
if len(formdata.Description) != 0 {
des, err := common.Untaint(formdata.Description, cfg.RegText)
if err != nil {
return JsonStatus(c, fiber.StatusForbidden,
"Invalid description: "+err.Error())
}
entry.Description = des
}
// get url [and zip if there are multiple files]
returnUrl := strings.Join([]string{cfg.Url, "form", id}, "/")
entry.Url = returnUrl