From 15f4f8956fb78e1e8d154385dc6649cb44a63c09 Mon Sep 17 00:00:00 2001 From: Samuel Hawksby-Robinson Date: Fri, 9 Sep 2022 14:40:18 +0100 Subject: [PATCH] Resolved gosec issue calling http.Get() from package default client --- protocol/urls/urls.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/protocol/urls/urls.go b/protocol/urls/urls.go index 6555842ac..b769b8b4a 100644 --- a/protocol/urls/urls.go +++ b/protocol/urls/urls.go @@ -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) }