Replaced math/rand (deprecated) with crypto/rand

This commit is contained in:
Dionysus 2023-12-27 15:01:43 -05:00
parent 14e947435b
commit 7cc0152d3e
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
1 changed files with 1 additions and 3 deletions

View File

@ -1,8 +1,8 @@
package main
import (
"crypto/rand"
"io"
"math/rand"
"net/http"
"os"
"strconv"
@ -138,7 +138,6 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
}
file.Seek(0, 0)
// Check if expiry time is present and length is too long
if r.PostFormValue("expiry") != "" {
ttl, err = strconv.ParseInt(r.PostFormValue("expiry"), 10, 64)
@ -177,7 +176,6 @@ func UploadHandler(w http.ResponseWriter, r *http.Request) {
fileNameLength = conf.FileLen
}
// generate + check name
for {
id := NameGen(fileNameLength)