def response_to_proxy_response(self, response, response_content):
proxy_response = aiohttp.Response(self.writer, response.status, http_version=response.version)
# Copy response headers, except for Content-Encoding header,
# since unfortunately aiohttp transparently decodes content.
proxy_response_headers = [(name, value)
for name, value
in response.headers.items() if name not in ('CONTENT-ENCODING',)]
proxy_response.add_headers(*proxy_response_headers)
proxy_response.send_headers()
proxy_response.write(response_content)
yield from proxy_response.write_eof()
评论列表
文章目录