Skip to content

Commit

Permalink
shadowserver collector: fix reports = '' behaviour
Browse files Browse the repository at this point in the history
it the parameter is an empty string (or only contains whitespace), behave as if the parameter is not set and select all reports

fixes certtools#2521
  • Loading branch information
sebix committed Aug 16, 2024
1 parent 96ba5aa commit b322bc5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def init(self):
raise ValueError('No secret provided.')

if isinstance(self.reports, str):
self._report_list = self.reports.split(',')
# if reports is an empty string (or only contains whitespace), behave as if the parameter is not set and select all reports
reports = self.reports.strip()
self._report_list = reports.split(',') if reports else []
elif isinstance(self.reports, list):
self._report_list = self.reports
if isinstance(self.types, str):
Expand Down

0 comments on commit b322bc5

Please sign in to comment.