From 9d733c80b2123cc1bbfb734dd91d23f2cddf0689 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 12 Jul 2023 11:38:28 +0200 Subject: [PATCH] Continued: - */* catches all, so let it pass as valid content type --- fba/helpers/json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fba/helpers/json.py b/fba/helpers/json.py index 8faeabd..4d5c846 100644 --- a/fba/helpers/json.py +++ b/fba/helpers/json.py @@ -26,7 +26,7 @@ def from_response(response: requests.models.Response) -> any: logger.debug("response[]='%s' - CALLED!", type(response)) if not isinstance(response, requests.models.Response): raise ValueError(f"Parameter response[]='{type(response)}' is not type of 'Response'") - elif response.headers.get("content-type") is None or response.headers.get("content-type").split(";")[0] not in ["application/json", "application/jrd+json", "application/activity+json"]: + elif response.headers.get("content-type") is None or response.headers.get("content-type").split(";")[0] not in ["*/*", "application/json", "application/jrd+json", "application/activity+json"]: logger.warning("response.headers[content-type]='%s' is not a JSON type, below json() invocation may raise an exception", response.headers.get("content-type")) data = list() -- 2.39.5