This commit is contained in:
Shivek Khurana 2021-01-20 16:54:41 +05:30 committed by Andrea Maria Piana
parent d37b7a9729
commit 2039305900
1 changed files with 2 additions and 5 deletions

View File

@ -30,7 +30,6 @@ type TenorOembedData struct {
AuthorName string `json:"author_name"` AuthorName string `json:"author_name"`
} }
type LinkPreviewData struct { type LinkPreviewData struct {
Site string `json:"site" meta:"og:site_name"` Site string `json:"site" meta:"og:site_name"`
Title string `json:"title" meta:"og:title"` Title string `json:"title" meta:"og:title"`
@ -48,7 +47,6 @@ const YoutubeOembedLink = "https://www.youtube.com/oembed?format=json&url=%s"
const GiphyOembedLink = "https://giphy.com/services/oembed?url=%s" const GiphyOembedLink = "https://giphy.com/services/oembed?url=%s"
const TenorOembedLink = "https://tenor.com/oembed?url=%s" const TenorOembedLink = "https://tenor.com/oembed?url=%s"
var httpClient = http.Client{ var httpClient = http.Client{
Timeout: 30 * time.Second, Timeout: 30 * time.Second,
} }
@ -84,7 +82,6 @@ func LinkPreviewWhitelist() []Site {
} }
func GetURLContent(url string) (data []byte, err error) { func GetURLContent(url string) (data []byte, err error) {
// nolint: gosec // nolint: gosec
response, err := httpClient.Get(url) response, err := httpClient.Get(url)
if err != nil { if err != nil {