return delete token

this somehow didnt end up in the previous commit??
This commit is contained in:
2026-11-10 13:14:44 -05:00
parent 4c25a66f0f
commit 77e28c42d2
+4 -1
View File
@@ -1,7 +1,9 @@
package main package main
import ( import (
"crypto/rand"
"crypto/sha256" "crypto/sha256"
"encoding/hex"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
@@ -28,7 +30,7 @@ func health(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "OK") fmt.Fprintln(w, "OK")
} }
type uploadInput struct { type UploadInput struct {
Reader io.Reader Reader io.Reader
Filename string Filename string
MIMEType string MIMEType string
@@ -191,6 +193,7 @@ func uploadHandler(db *gorm.DB, cfg Config) http.HandlerFunc {
SHA256: hasher.Sum(nil), SHA256: hasher.Sum(nil),
CreatedAt: createdAt, CreatedAt: createdAt,
LastAccessedAt: createdAt, LastAccessedAt: createdAt,
DeleteToken: rand.Text(),
} }
err = insertUpload(db, &upload) err = insertUpload(db, &upload)
if err != nil { if err != nil {