1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-31 18:31:01 +00:00

feat: implement proxy URL per feed

This commit is contained in:
Frédéric Guillot 2025-04-06 18:04:50 -07:00
parent 7b344de846
commit ef22e95f8b
48 changed files with 333 additions and 192 deletions

View file

@ -28,6 +28,7 @@ type SubscriptionForm struct {
KeeplistRules string
UrlRewriteRules string
DisableHTTP2 bool
ProxyURL string
}
// Validate makes sure the form values locale.are valid.
@ -52,6 +53,10 @@ func (s *SubscriptionForm) Validate() *locale.LocalizedError {
return locale.NewLocalizedError("error.feed_invalid_urlrewrite_rule")
}
if s.ProxyURL != "" && !validator.IsValidURL(s.ProxyURL) {
return locale.NewLocalizedError("error.invalid_feed_proxy_url")
}
return nil
}
@ -78,5 +83,6 @@ func NewSubscriptionForm(r *http.Request) *SubscriptionForm {
KeeplistRules: r.FormValue("keeplist_rules"),
UrlRewriteRules: r.FormValue("urlrewrite_rules"),
DisableHTTP2: r.FormValue("disable_http2") == "1",
ProxyURL: r.FormValue("proxy_url"),
}
}