From 67ab30a5ba74e8b6784f823f28c2ee902e94f690 Mon Sep 17 00:00:00 2001 From: Daniel Grana Date: Tue, 10 Mar 2009 17:51:03 +0000 Subject: [PATCH] core: add application/xhtml+xml support to responsetypes more info at http://www.w3.org/TR/xhtml-media-types/#media-types --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40977 --- scrapy/trunk/scrapy/core/downloader/responsetypes/__init__.py | 1 + scrapy/trunk/scrapy/tests/test_responsetypes.py | 1 + 2 files changed, 2 insertions(+) diff --git a/scrapy/trunk/scrapy/core/downloader/responsetypes/__init__.py b/scrapy/trunk/scrapy/core/downloader/responsetypes/__init__.py index fc8e98d33..4c09ebd83 100644 --- a/scrapy/trunk/scrapy/core/downloader/responsetypes/__init__.py +++ b/scrapy/trunk/scrapy/core/downloader/responsetypes/__init__.py @@ -16,6 +16,7 @@ class ResponseTypes(object): CLASSES = { 'text/html': 'scrapy.http.HtmlResponse', + 'application/xhtml+xml': 'scrapy.http.HtmlResponse', 'application/xml': 'scrapy.http.XmlResponse', 'text/xml': 'scrapy.http.XmlResponse', 'text': 'scrapy.http.TextResponse', diff --git a/scrapy/trunk/scrapy/tests/test_responsetypes.py b/scrapy/trunk/scrapy/tests/test_responsetypes.py index 76c4e7822..14f3cf387 100644 --- a/scrapy/trunk/scrapy/tests/test_responsetypes.py +++ b/scrapy/trunk/scrapy/tests/test_responsetypes.py @@ -31,6 +31,7 @@ class ResponseTypesTest(unittest.TestCase): mappings = [ ('text/html; charset=UTF-8', HtmlResponse), ('text/xml; charset=UTF-8', XmlResponse), + ('application/xhtml+xml; charset=UTF-8', HtmlResponse), ('application/xml; charset=UTF-8', XmlResponse), ('application/octet-stream', Response), ]