From e91a7922a74cf8f407ee251845ac804e9d25b95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 2 Feb 2024 13:06:49 +0100 Subject: [PATCH] fix: another call that cn be a list or a dict. --- pymisp/api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index d7046eb..3537a7d 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -1333,13 +1333,16 @@ class PyMISP: warninglist_id = get_uuid_or_id_from_abstract_misp(warninglist) return self.toggle_warninglist(warninglist_id=warninglist_id, force_enable=False) - def values_in_warninglist(self, value: Iterable[str]) -> dict[str, Any]: + def values_in_warninglist(self, value: Iterable[str]) -> dict[str, Any] | list[dict[str, Any]]: """Check if IOC values are in warninglist :param value: iterator with values to check """ response = self._prepare_request('POST', 'warninglists/checkValue', data=value) - return self._check_json_response(response) + try: + return self._check_json_response_list(response) + except PyMISPError: + return self._check_json_response(response) def update_warninglists(self) -> dict[str, Any]: """Update all the warninglists: https://www.misp-project.org/openapi/#tag/Warninglists/operation/updateWarninglists"""