From a8b839fc34fe0b63bcb7ccdadfdefa11734a0f1c Mon Sep 17 00:00:00 2001 From: bmartel Date: Wed, 8 Jan 2025 10:54:33 -0600 Subject: [PATCH] fix: OPTIC-1490: Safely reference content_type of the response so it does not error (#6856) Co-authored-by: Max Tkachenko Co-authored-by: Marcel Canu --- label_studio/core/utils/contextlog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/label_studio/core/utils/contextlog.py b/label_studio/core/utils/contextlog.py index a1042609ab1b..b5a2193c161e 100644 --- a/label_studio/core/utils/contextlog.py +++ b/label_studio/core/utils/contextlog.py @@ -271,7 +271,7 @@ def create_payload(self, request, response, body): else: namespace = request.resolver_match.namespace if request.resolver_match else None status_code = response.status_code - content_type = response.content_type + content_type = getattr(response, 'content_type', None) response_content = self._get_response_content(response) payload = {