From 80e24f0c780725bc854362def00211e88cb673bd Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Sat, 17 Feb 2024 21:49:05 +0100 Subject: Respect multiple urls in domain- and urlfilter --- modules/urlfilter/urlfilter.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/urlfilter/urlfilter.go') diff --git a/modules/urlfilter/urlfilter.go b/modules/urlfilter/urlfilter.go index 1297c35..58675e8 100644 --- a/modules/urlfilter/urlfilter.go +++ b/modules/urlfilter/urlfilter.go @@ -16,6 +16,7 @@ func init() { type Module struct { URL string `json:"url"` + URLs []string `json:"urls"` AllowedURLs []string `json:"allowedURLs"` BlockedURLs []string `json:"blockedURLs"` @@ -61,6 +62,11 @@ func (m *Module) ValidateRequest(r *flyscrape.Request) bool { if r.URL == m.URL { return true } + for _, u := range m.URLs { + if r.URL == u { + return true + } + } // allow if no filter is set if len(m.allowedURLsRE) == 0 && len(m.blockedURLsRE) == 0 { -- cgit v1.2.3