1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-22 00:13:08 +00:00

Merge pull request #1503 from demelziraptor/amazon-json-response

[MRG+1] interpreting json-amazonui-streaming as TextResponse
This commit is contained in:
Elias Dorneles 2016-09-12 13:21:16 -03:00 committed by GitHub
commit 129421c7e3
2 changed files with 2 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class ResponseTypes(object):
'application/xml': 'scrapy.http.XmlResponse',
'application/json': 'scrapy.http.TextResponse',
'application/x-json': 'scrapy.http.TextResponse',
'application/json-amazonui-streaming': 'scrapy.http.TextResponse',
'application/javascript': 'scrapy.http.TextResponse',
'application/x-javascript': 'scrapy.http.TextResponse',
'text/xml': 'scrapy.http.XmlResponse',

View File

@ -43,6 +43,7 @@ class ResponseTypesTest(unittest.TestCase):
('application/xml; charset=UTF-8', XmlResponse),
('application/octet-stream', Response),
('application/x-json; encoding=UTF8;charset=UTF-8', TextResponse),
('application/json-amazonui-streaming;charset=UTF-8', TextResponse),
]
for source, cls in mappings:
retcls = responsetypes.from_content_type(source)