ASGI requires the whole body
This commit is contained in:
parent
7041c19b57
commit
9cd2345c80
1 changed files with 9 additions and 5 deletions
|
|
@ -120,6 +120,10 @@ class SassAsyncMiddleware(_MiddlewareFactory):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
resp_body = b''
|
||||||
|
async for chunk in _read_file(os.path.join(package_dir, result)):
|
||||||
|
resp_body += chunk
|
||||||
|
|
||||||
await send({
|
await send({
|
||||||
'type': 'http.response.start',
|
'type': 'http.response.start',
|
||||||
'status': 200,
|
'status': 200,
|
||||||
|
|
@ -127,11 +131,11 @@ class SassAsyncMiddleware(_MiddlewareFactory):
|
||||||
(b'Content-Type', b'text/css; charset=utf-8'),
|
(b'Content-Type', b'text/css; charset=utf-8'),
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
async for chunk in _read_file(os.path.join(package_dir, result)):
|
|
||||||
await send({
|
await send({
|
||||||
'type': 'http.response.body',
|
'type': 'http.response.body',
|
||||||
'body': chunk
|
'body': resp_body
|
||||||
})
|
})
|
||||||
|
|
||||||
await self.app(scope, receive, send)
|
await self.app(scope, receive, send)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue