diff --git a/tests/addons/status_code.py b/tests/addons/status_code.py index 1b11f8a..4f11906 100644 --- a/tests/addons/status_code.py +++ b/tests/addons/status_code.py @@ -33,7 +33,12 @@ def configure(self, updates): self.reset() return self.config = ctx.options.statuscode - print(f"statuscode will return HTTP {self.config['return_status']} filter={self.config.get('filter', {})}") + new_filter = self.config.get('filter', None) + print(f"statuscode will return HTTP {self.config['return_status']} filter={new_filter}") + if new_filter: + self.filter = flowfilter.parse(new_filter) + else: + self.filter = self.matchall def response(self, flow): # always ignore the controller @@ -43,5 +48,3 @@ def response(self, flow): return # ignore responses if we aren't told a code if flowfilter.match(self.filter, flow): flow.response = Response.make(self.config["return_status"]) - else: - print("flow does not match filter")