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
This commit is contained in:
Daniel Grana 2009-03-10 17:51:03 +00:00
parent 63e6ce6e47
commit 67ab30a5ba
2 changed files with 2 additions and 0 deletions

View File

@ -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',

View File

@ -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),
]