Resolved gosec issue calling http.Get() from package default client

This commit is contained in:
Samuel Hawksby-Robinson 2022-09-09 14:40:18 +01:00
parent 505ef579eb
commit 15f4f8956f
1 changed files with 4 additions and 4 deletions

View File

@ -100,12 +100,12 @@ func LinkPreviewWhitelist() []Site {
Address: "github.com",
ImageSite: false,
},
Site{
{
Title: "tenor GIFs subdomain",
Address: "media.tenor.com",
ImageSite: false,
},
Site{
{
Title: "tenor GIFs",
Address: "tenor.com",
ImageSite: false,
@ -218,10 +218,10 @@ func GetGiphyPreviewData(link string) (previewData LinkPreviewData, err error) {
return previewData, nil
}
// Giphy has a shortener service called gph.is, the oembed service doesn't work with shortened urls,
// GetGiphyLongURL Giphy has a shortener service called gph.is, the oembed service doesn't work with shortened urls,
// so we need to fetch the long url first
func GetGiphyLongURL(shortURL string) (longURL string, err error) {
res, err := http.Get(shortURL)
res, err := httpClient.Get(shortURL)
if err != nil {
return longURL, fmt.Errorf("can't get bytes from Giphy's short url at %s", shortURL)
}