diff --git a/siesta/__init__.py b/siesta/__init__.py index c655f85..04f353b 100644 --- a/siesta/__init__.py +++ b/siesta/__init__.py @@ -220,8 +220,8 @@ def _getresponse(self, method, url, body={}, headers={}, meta={}): resource = Resource(uri=urlparse(location).path, api=self.api).get() return resource #logging.info("resp.getheader(): %s" % resp.getheader('content-type')) - m = re.match('^([^;]*)(?:;\s*charset=(.*))?$', - resp.getheader('content-type')) + type = resp.getheader('content-type', '') + m = re.match('^([^;]*)(?:;\s*charset=(.*))?$', type) #logging.info("response: %s" % resp) if m == None: