remove the mess caused by merge conflict
This commit is contained in:
parent
ccd7001726
commit
ee97319a59
1 changed files with 7 additions and 14 deletions
|
|
@ -113,13 +113,6 @@ class SassAsyncMiddleware(_MiddlewareFactory):
|
||||||
'type': 'http.response.body',
|
'type': 'http.response.body',
|
||||||
'body': resp_body
|
'body': resp_body
|
||||||
})
|
})
|
||||||
await send({
|
|
||||||
'type': 'http.response.start',
|
|
||||||
'status': self.error_status,
|
|
||||||
'headers': [
|
|
||||||
(b'Content-Type', b'text/css; charset=utf-8'),
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
async def _read_file(path):
|
async def _read_file(path):
|
||||||
with open(path, 'rb') as f:
|
with open(path, 'rb') as f:
|
||||||
|
|
@ -130,21 +123,21 @@ class SassAsyncMiddleware(_MiddlewareFactory):
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
await send({
|
||||||
|
'type': 'http.response.start',
|
||||||
|
'status': 200,
|
||||||
|
'headers': [
|
||||||
|
(b'Content-Type', b'text/css; charset=utf-8'),
|
||||||
|
(b'Content-Length', want_bytes(f'{os.path.getsize(path)}'))
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
async for chunk in _read_file(os.path.join(package_dir, result)):
|
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': chunk
|
||||||
})
|
})
|
||||||
|
|
||||||
await send({
|
|
||||||
'type': 'http.response.start',
|
|
||||||
'status': 200,
|
|
||||||
'headers': [
|
|
||||||
(b'Content-Type', b'text/css; charset=utf-8'),
|
|
||||||
(b'Content-Length', want_bytes(f'{len(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