Skip to content

Commit b61d907

Browse files
committed
fix problem with NoneType response headers
1 parent 8fe6cee commit b61d907

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

openprocurement_client/clients.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ def _get_resource_item(self, url, headers=None):
8888
response_item = self.request('GET', url, headers=_headers)
8989
if response_item.status_code == 200:
9090
data = loads(response_item.text)
91-
if "x-revision-n" in response_item.headers:
92-
data["x_revision_n"] = response_item.headers["x-revision-n"]
93-
if "x-revision-data" in response_item.headers:
94-
data["x_revision_data"] = response_item.headers["x-revision-data"]
91+
if isinstance(response_item.headers, dict):
92+
if "x-revision-n" in response_item.headers:
93+
data["x_revision_n"] = response_item.headers["x-revision-n"]
94+
if "x-revision-data" in response_item.headers:
95+
data["x_revision_data"] = response_item.headers["x-revision-data"]
9596
return munchify(data)
9697
raise InvalidResponse(response_item)
9798

0 commit comments

Comments
 (0)