Skip to content

Commit dae37d6

Browse files
committed
Revert "Cast CaseInsensitiveDict into dicts to make them JSON serializable"
This reverts commit aca6226.
1 parent 4f56386 commit dae37d6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

readthedocs/integrations/models.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,12 @@ def from_requests_exchange(self, response, related_object):
101101
:param related_object: Object to use for generic relationship.
102102
"""
103103
request = response.request
104-
# NOTE: we need to cast ``request.headers`` and ``response.headers``
105-
# because it's a ``requests.structures.CaseInsensitiveDict`` which is
106-
# not JSON serializable.
107104
obj = self.create(
108105
related_object=related_object,
109-
request_headers=dict(request.headers) or {},
106+
request_headers=request.headers or {},
110107
request_body=request.body or '',
111108
status_code=response.status_code,
112-
response_headers=dict(response.headers),
109+
response_headers=response.headers,
113110
response_body=response.text,
114111
)
115112
self.delete_limit(related_object)

0 commit comments

Comments
 (0)