]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 2 Jul 2023 20:34:28 +0000 (22:34 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 2 Jul 2023 20:53:20 +0000 (22:53 +0200)
- also don't output a warning for "application/jrd+json"
- same for "application/activity+json"

fba/helpers/json.py

index 9681e60ab98e82e1e778fe224d4456d13e7ecd94..8faeabd924b5067fd5be28a7d3a003e15654c12b 100644 (file)
@@ -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] != "application/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()