From 77e28c42d213357abfe420ddc18a15b82536f9b2 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Tue, 10 Nov 2026 13:14:44 -0500 Subject: [PATCH] return delete token this somehow didnt end up in the previous commit?? --- handlers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/handlers.go b/handlers.go index 1239755..5d0a23c 100644 --- a/handlers.go +++ b/handlers.go @@ -1,7 +1,9 @@ package main import ( + "crypto/rand" "crypto/sha256" + "encoding/hex" "encoding/json" "errors" "fmt" @@ -28,7 +30,7 @@ func health(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "OK") } -type uploadInput struct { +type UploadInput struct { Reader io.Reader Filename string MIMEType string @@ -191,6 +193,7 @@ func uploadHandler(db *gorm.DB, cfg Config) http.HandlerFunc { SHA256: hasher.Sum(nil), CreatedAt: createdAt, LastAccessedAt: createdAt, + DeleteToken: rand.Text(), } err = insertUpload(db, &upload) if err != nil {