mirror of https://github.com/scrapy/scrapy.git
interpreting application/x-json as TextResponse
This commit is contained in:
parent
3fc4e0b319
commit
9a15fcf89a
|
|
@ -24,6 +24,7 @@ class ResponseTypes(object):
|
|||
'application/vnd.wap.xhtml+xml': 'scrapy.http.HtmlResponse',
|
||||
'application/xml': 'scrapy.http.XmlResponse',
|
||||
'application/json': 'scrapy.http.TextResponse',
|
||||
'application/x-json': 'scrapy.http.TextResponse',
|
||||
'application/javascript': 'scrapy.http.TextResponse',
|
||||
'application/x-javascript': 'scrapy.http.TextResponse',
|
||||
'text/xml': 'scrapy.http.XmlResponse',
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ class ResponseTypesTest(unittest.TestCase):
|
|||
('application/vnd.wap.xhtml+xml; charset=utf-8', HtmlResponse),
|
||||
('application/xml; charset=UTF-8', XmlResponse),
|
||||
('application/octet-stream', Response),
|
||||
('application/x-json; encoding=UTF8;charset=UTF-8', TextResponse),
|
||||
]
|
||||
for source, cls in mappings:
|
||||
retcls = responsetypes.from_content_type(source)
|
||||
|
|
|
|||
Loading…
Reference in New Issue