Handle content-type header with parameters when debugging requests
This commit is contained in:
parent
1c1b9ef927
commit
721f2a0d69
1 changed files with 2 additions and 1 deletions
|
@ -65,8 +65,9 @@ class PyiCloudSession(requests.Session):
|
||||||
|
|
||||||
response = super(PyiCloudSession, self).request(*args, **kwargs)
|
response = super(PyiCloudSession, self).request(*args, **kwargs)
|
||||||
|
|
||||||
|
content_type = response.headers.get('Content-Type', '').split(';')[0]
|
||||||
json_mimetypes = ['application/json', 'text/json']
|
json_mimetypes = ['application/json', 'text/json']
|
||||||
if not response.headers['Content-Type'] in json_mimetypes:
|
if content_type not in json_mimetypes:
|
||||||
return response
|
return response
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue