This commit is contained in:
yumoqing 2022-03-22 12:37:43 +08:00
parent c3378bb10f
commit 4ce3f10fc0

View File

@ -30,16 +30,16 @@ class ProxyProcessor(BaseProcessor):
allow_redirects=False, allow_redirects=False,
data=await request.read()) as res: data=await request.read()) as res:
headers = res.headers.copy() headers = res.headers.copy()
# body = await res.read() body = await res.read()
self.retResponse = web.Response( self.retResponse = web.StreamResponse(
headers = headers, headers = headers,
status = res.status status = res.status
# , body=body body=body
) )
await self.retResponse.prepare(request) # await self.retResponse.prepare(request)
async for chunk in res.content.iter_chunked(chunk_size): async for chunk in res.content.iter_chunked(chunk_size):
await self.retResponse.write(chunk) await self.retResponse.write(chunk)
print('proxy: datahandle() finish', self.retResponse) print('proxy: datahandle() finish', self.res)
def setheaders(self): def setheaders(self):