Fixed reports request

This commit is contained in:
2026-04-03 16:48:44 +03:00
parent 65c04d1578
commit e03aed78f0
2 changed files with 19 additions and 15 deletions
+2 -2
View File
@@ -36,8 +36,8 @@ class Request:
try:
response = requests.get(url=full_url, params=payload)
if response.headers['Content-Type'] == 'application/json' or \
response.headers['Content-Type'] == 'application/json; charset=utf-8':
if ('Content-Type' in response.headers and response.headers['Content-Type'] == 'application/json') or \
('Content-Type' in response.headers and response.headers['Content-Type'] == 'application/json; charset=utf-8'):
return response.json()
else:
return response