From 8259a01d64d020e45ab72f4e13988da139a34fcd Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 7 Mar 2013 23:08:37 +0100 Subject: [PATCH] Fix URLs with no content type header. --- dosagelib/comic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dosagelib/comic.py b/dosagelib/comic.py index d69957ebb..90bfb1b29 100644 --- a/dosagelib/comic.py +++ b/dosagelib/comic.py @@ -53,7 +53,7 @@ class ComicImage(object): self.urlobj = getImageObject(self.url, self.referrer, self.session) except IOError as msg: raise IOError('error retrieving URL %s: %s' % (self.url, msg)) - content_type = unquote(self.urlobj.headers.get('content-type')) + content_type = unquote(self.urlobj.headers.get('content-type', 'application/octet-stream')) content_type = content_type.split(';', 1)[0] if '/' in content_type: maintype, subtype = content_type.split('/', 1)