diff --git a/ably/http/http.py b/ably/http/http.py index 82eaddc6..e2607ca0 100644 --- a/ably/http/http.py +++ b/ably/http/http.py @@ -92,12 +92,13 @@ def to_native(self): return None content_type = self.__response.headers.get('content-type') - if content_type == 'application/x-msgpack': - return msgpack.unpackb(content) - elif content_type == 'application/json': - return self.__response.json() - else: - raise ValueError("Unsupported content type") + if isinstance(content_type, str): + if content_type.startswith('application/x-msgpack'): + return msgpack.unpackb(content) + elif content_type.startswith('application/json'): + return self.__response.json() + + raise ValueError("Unsupported content type") @property def response(self):