1
0
Fork 0
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:
Frédéric Guillot 2020-11-06 17:39:10 -08:00
parent 40e983664c
commit 246a48359c
2 changed files with 26 additions and 3 deletions

View file

@ -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