return delete token
this somehow didnt end up in the previous commit??
This commit is contained in:
+4
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user