From 1a2146d11a049b24d761d362778ae2b82f8ff443 Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Mon, 1 Nov 2010 16:09:33 -0200 Subject: [PATCH] Fixed bug detecting response types for some urls. Closes #281 --- scrapy/core/downloader/responsetypes/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scrapy/core/downloader/responsetypes/__init__.py b/scrapy/core/downloader/responsetypes/__init__.py index 51631b282..8b5c14258 100644 --- a/scrapy/core/downloader/responsetypes/__init__.py +++ b/scrapy/core/downloader/responsetypes/__init__.py @@ -81,10 +81,6 @@ class ResponseTypes(object): else: return Response - def from_url(self, url): - """Return the most appropiate Response class from a URL""" - return self.from_mimetype(self.mimetypes.guess_type(url)[0]) - def from_body(self, body): """Try to guess the appropiate response based on the body content. This method is a bit magic and could be improved in the future, but @@ -106,7 +102,7 @@ class ResponseTypes(object): if headers is not None: cls = self.from_headers(headers) if cls is Response and url is not None: - cls = self.from_url(url) + cls = self.from_filename(url) if cls is Response and filename is not None: cls = self.from_filename(filename) if cls is Response and body is not None: