Skip to content

Commit

Permalink
Handle type parameter as a string and match by type instead of filena…
Browse files Browse the repository at this point in the history
…me substring.
  • Loading branch information
elsif2 committed Apr 18, 2024
1 parent 6683c88 commit 2cc2642
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions intelmq/bots/collectors/shadowserver/collector_reports_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def init(self):
self._report_list = self.reports.split(',')
elif isinstance(self.reports, list):
self._report_list = self.reports

if isinstance(self.types, str):
self.types = self.types.split(',')
if self.country and self.country not in self._report_list:
self.logger.warn("Deprecated parameter 'country' found. Please use 'reports' instead. The backwards-compatibility will be removed in IntelMQ version 4.0.0.")
self._report_list.append(self.country)
Expand Down Expand Up @@ -110,8 +111,7 @@ def _reports_list(self, date=None):
return None

if self.types:
reports = [report for report in reports if any(rtype in report['file'] for rtype in self.types)]

reports = [report for report in reports if any(report['type'] == rtype for rtype in self.types)]
return reports

def _report_download(self, reportid: str):
Expand Down

0 comments on commit 2cc2642

Please sign in to comment.