1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-16 18:01:37 +00:00

Move HTTP client to its own package

This commit is contained in:
Frédéric Guillot 2018-04-28 10:51:07 -07:00
parent 04adf5fdf5
commit 1eba1730d1
13 changed files with 64 additions and 64 deletions

View file

@ -12,7 +12,7 @@ import (
"strings"
"github.com/miniflux/miniflux/crypto"
"github.com/miniflux/miniflux/http"
"github.com/miniflux/miniflux/http/client"
"github.com/miniflux/miniflux/logger"
"github.com/miniflux/miniflux/model"
"github.com/miniflux/miniflux/url"
@ -23,8 +23,8 @@ import (
// FindIcon try to find the website's icon.
func FindIcon(websiteURL string) (*model.Icon, error) {
rootURL := url.RootURL(websiteURL)
client := http.NewClient(rootURL)
response, err := client.Get()
clt := client.New(rootURL)
response, err := clt.Get()
if err != nil {
return nil, fmt.Errorf("unable to download website index page: %v", err)
}
@ -87,8 +87,8 @@ func parseDocument(websiteURL string, data io.Reader) (string, error) {
}
func downloadIcon(iconURL string) (*model.Icon, error) {
client := http.NewClient(iconURL)
response, err := client.Get()
clt := client.New(iconURL)
response, err := clt.Get()
if err != nil {
return nil, fmt.Errorf("unable to download iconURL: %v", err)
}