Handle content-type header with parameters when debugging requests

This commit is contained in:
Tor Arne Vestbø 2016-04-02 22:05:10 +02:00
parent 1c1b9ef927
commit 721f2a0d69

View file

@ -65,8 +65,9 @@ class PyiCloudSession(requests.Session):
response = super(PyiCloudSession, self).request(*args, **kwargs)
content_type = response.headers.get('Content-Type', '').split(';')[0]
json_mimetypes = ['application/json', 'text/json']
if not response.headers['Content-Type'] in json_mimetypes:
if content_type not in json_mimetypes:
return response
try: