mirror of https://github.com/scrapy/scrapy.git
decode body from utf-8, as scrapy stores body as bytes, and twisted has already converted to unicode
This commit is contained in:
parent
9f2be23a39
commit
73ff87c1dc
|
|
@ -132,6 +132,9 @@ class ScrapyHTTPClientFactory(HTTPClientFactory):
|
|||
status = int(self.status)
|
||||
headers = Headers(self.response_headers)
|
||||
respcls = responsetypes.from_args(headers=headers, url=self.url)
|
||||
# XXX - scrapy response stores body as bytes,
|
||||
# but maybe it makes sense to be able to store unicode?
|
||||
body = to_bytes(body)
|
||||
return respcls(url=self.url, status=status, headers=headers, body=body)
|
||||
|
||||
def _set_connection_attributes(self, request):
|
||||
|
|
|
|||
Loading…
Reference in New Issue