mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
http client: remove dependency on global config options
This commit is contained in:
parent
065331c77f
commit
16b7b3bc3e
7 changed files with 148 additions and 72 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"io"
|
||||
"strings"
|
||||
|
||||
"miniflux.app/config"
|
||||
"miniflux.app/http/client"
|
||||
"miniflux.app/logger"
|
||||
"miniflux.app/reader/readability"
|
||||
|
@ -20,7 +21,7 @@ import (
|
|||
|
||||
// Fetch downloads a web page and returns relevant contents.
|
||||
func Fetch(websiteURL, rules, userAgent string) (string, error) {
|
||||
clt := client.New(websiteURL)
|
||||
clt := client.NewClientWithConfig(websiteURL, config.Opts)
|
||||
if userAgent != "" {
|
||||
clt.WithUserAgent(userAgent)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue