mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Add the possibility to override default user agent for each feed
This commit is contained in:
parent
1d335390c2
commit
2538eea177
29 changed files with 129 additions and 22 deletions
|
@ -19,8 +19,12 @@ import (
|
|||
)
|
||||
|
||||
// Fetch downloads a web page a returns relevant contents.
|
||||
func Fetch(websiteURL, rules string) (string, error) {
|
||||
func Fetch(websiteURL, rules, userAgent string) (string, error) {
|
||||
clt := client.New(websiteURL)
|
||||
if userAgent != "" {
|
||||
clt.WithUserAgent(userAgent)
|
||||
}
|
||||
|
||||
response, err := clt.Get()
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue