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

@ -20,8 +20,8 @@ type YoutubeOembedData struct {
type GiphyOembedData struct {
ProviderName string `json:"provider_name"`
Title string `json:"title"`
URL string `json:"url"`
Title string `json:"title"`
URL string `json:"url"`
}
type TenorOembedData struct {
@ -30,7 +30,6 @@ type TenorOembedData struct {
AuthorName string `json:"author_name"`
}
type LinkPreviewData struct {
Site string `json:"site" meta:"og:site_name"`
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 TenorOembedLink = "https://tenor.com/oembed?url=%s"
var httpClient = http.Client{
Timeout: 30 * time.Second,
}
@ -84,7 +82,6 @@ func LinkPreviewWhitelist() []Site {
}
func GetURLContent(url string) (data []byte, err error) {
// nolint: gosec
response, err := httpClient.Get(url)
if err != nil {