Add share download endpoint

This commit is contained in:
Deluan
2023-03-10 20:46:13 -05:00
committed by Deluan Quintão
parent 50d9838652
commit a22eef39f7
7 changed files with 64 additions and 27 deletions
+16
View File
@@ -0,0 +1,16 @@
package public
import (
"net/http"
)
func (p *Router) handleDownloads(w http.ResponseWriter, r *http.Request) {
id := r.URL.Query().Get(":id")
if id == "" {
http.Error(w, "invalid id", http.StatusBadRequest)
return
}
err := p.archiver.ZipShare(r.Context(), id, w)
checkShareError(r.Context(), w, err, id)
}