Use two more references

master
Jan-Lukas Else 2020-04-20 20:59:11 +02:00
parent cfc8911b77
commit 09e3b77453
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ type Tinify struct {
key string key string
} }
func (t Tinify) Compress(url string) (location string, err error) { func (t *Tinify) Compress(url string) (location string, err error) {
fileExtension := func() string { fileExtension := func() string {
spliced := strings.Split(url, ".") spliced := strings.Split(url, ".")
return spliced[len(spliced)-1] return spliced[len(spliced)-1]

View File

@ -26,7 +26,7 @@ type BunnyCdnStorage struct {
var bunnyCdnStorageUrl = "https://storage.bunnycdn.com" var bunnyCdnStorageUrl = "https://storage.bunnycdn.com"
func (b BunnyCdnStorage) Upload(fileName string, file multipart.File) (location string, err error) { func (b *BunnyCdnStorage) Upload(fileName string, file multipart.File) (location string, err error) {
client := &http.Client{} client := &http.Client{}
req, _ := http.NewRequest(http.MethodPut, bunnyCdnStorageUrl+"/"+url.PathEscape(b.storageZoneName)+"/"+url.PathEscape("/"+fileName), file) req, _ := http.NewRequest(http.MethodPut, bunnyCdnStorageUrl+"/"+url.PathEscape(b.storageZoneName)+"/"+url.PathEscape("/"+fileName), file)
req.Header.Add("AccessKey", b.key) req.Header.Add("AccessKey", b.key)