mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Do not follow redirects when trying known feed URLs
Some websites redirects unknown URLs to the home page. As result, the list of known URLs is returned to the subscription list. We don't want the user to choose between invalid feed URLs.
This commit is contained in:
parent
40e983664c
commit
246a48359c
2 changed files with 26 additions and 3 deletions
|
@ -156,9 +156,16 @@ func tryWellKnownUrls(websiteURL, userAgent, username, password string) (Subscri
|
|||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
clt := client.NewClientWithConfig(fullURL, config.Opts)
|
||||
clt.WithCredentials(username, password)
|
||||
clt.WithUserAgent(userAgent)
|
||||
|
||||
// Some websites redirects unknown URLs to the home page.
|
||||
// As result, the list of known URLs is returned to the subscription list.
|
||||
// We don't want the user to choose between invalid feed URLs.
|
||||
clt.WithoutRedirects()
|
||||
|
||||
response, err := clt.Get()
|
||||
if err != nil {
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue