mirror of
https://github.com/miniflux/v2.git
synced 2025-07-02 16:38:37 +00:00
Add HTTP proxy option for subscriptions
This commit is contained in:
parent
0f258fd55b
commit
cf7712acea
40 changed files with 201 additions and 65 deletions
|
@ -34,6 +34,7 @@ type Feed struct {
|
|||
Password string `json:"password"`
|
||||
Disabled bool `json:"disabled"`
|
||||
IgnoreHTTPCache bool `json:"ignore_http_cache"`
|
||||
FetchViaProxy bool `json:"fetch_via_proxy"`
|
||||
Category *Category `json:"category,omitempty"`
|
||||
Entries Entries `json:"entries,omitempty"`
|
||||
Icon *FeedIcon `json:"icon"`
|
||||
|
@ -71,13 +72,14 @@ func (f *Feed) WithCategoryID(categoryID int64) {
|
|||
}
|
||||
|
||||
// WithBrowsingParameters defines browsing parameters.
|
||||
func (f *Feed) WithBrowsingParameters(crawler bool, userAgent, username, password, scraperRules, rewriteRules string) {
|
||||
func (f *Feed) WithBrowsingParameters(crawler bool, userAgent, username, password, scraperRules, rewriteRules string, fetchViaProxy bool) {
|
||||
f.Crawler = crawler
|
||||
f.UserAgent = userAgent
|
||||
f.Username = username
|
||||
f.Password = password
|
||||
f.ScraperRules = scraperRules
|
||||
f.RewriteRules = rewriteRules
|
||||
f.FetchViaProxy = fetchViaProxy
|
||||
}
|
||||
|
||||
// WithError adds a new error message and increment the error counter.
|
||||
|
|
|
@ -48,7 +48,7 @@ func TestFeedCategorySetter(t *testing.T) {
|
|||
|
||||
func TestFeedBrowsingParams(t *testing.T) {
|
||||
feed := &Feed{}
|
||||
feed.WithBrowsingParameters(true, "Custom User Agent", "Username", "Secret", "Some Rule", "Another Rule")
|
||||
feed.WithBrowsingParameters(true, "Custom User Agent", "Username", "Secret", "Some Rule", "Another Rule", false)
|
||||
|
||||
if !feed.Crawler {
|
||||
t.Error(`The crawler must be activated`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue