From 38fd368e3376e801b3391640da8ec7a59ebcb3fe Mon Sep 17 00:00:00 2001 From: ardevd Date: Tue, 6 May 2025 23:14:16 +0200 Subject: [PATCH] fix: corrected content-type header check. content type can be both `application/json` and `application/graphql-response-json` for example, so we simply check for the phrase `json` in the content-type header --- dimo/request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dimo/request.py b/dimo/request.py index 1bc6ad0..f5c8039 100644 --- a/dimo/request.py +++ b/dimo/request.py @@ -51,7 +51,7 @@ def __call__(self, headers=None, data=None, params=None, **kwargs): raise HTTPError(status=status or -1, message=str(exc), body=body) content_type = response.headers.get("Content-Type", "") - if "application/json" in content_type: + if "json" in content_type: return response.json() return response.content