Improved icon fetching with DriveCache disabled
Some checks failed
Run Integration Tests / test (push) Failing after 37s
Some checks failed
Run Integration Tests / test (push) Failing after 37s
This commit is contained in:
parent
43d7068c7a
commit
b17b9bc05f
6 changed files with 239 additions and 131 deletions
20
common.go
Executable file → Normal file
20
common.go
Executable file → Normal file
|
@ -1,8 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"html/template"
|
||||
|
@ -110,15 +108,15 @@ func renderTemplate(w http.ResponseWriter, tmplName string, data map[string]inte
|
|||
}
|
||||
}
|
||||
|
||||
// Randoms string generator used for auth code
|
||||
func generateStrongRandomString(length int) string {
|
||||
bytes := make([]byte, length)
|
||||
_, err := rand.Read(bytes)
|
||||
if err != nil {
|
||||
printErr("Error generating random string: %v", err)
|
||||
}
|
||||
return base64.URLEncoding.EncodeToString(bytes)[:length]
|
||||
}
|
||||
// // Randoms string generator used for auth code
|
||||
// func generateStrongRandomString(length int) string {
|
||||
// bytes := make([]byte, length)
|
||||
// _, err := rand.Read(bytes)
|
||||
// if err != nil {
|
||||
// printErr("Error generating random string: %v", err)
|
||||
// }
|
||||
// return base64.URLEncoding.EncodeToString(bytes)[:length]
|
||||
// }
|
||||
|
||||
// Checks if the URL already includes a protocol
|
||||
func hasProtocol(url string) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue