remove the mess caused by merge conflict

This commit is contained in:
Yusur 2025-08-10 11:43:35 +02:00
parent ccd7001726
commit ee97319a59

View file

@ -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:
@ -129,22 +122,22 @@ class SassAsyncMiddleware(_MiddlewareFactory):
yield chunk yield chunk
else: else:
break break
async for chunk in _read_file(os.path.join(package_dir, result)):
await send({
'type': 'http.response.body',
'body': chunk
})
await send({ await send({
'type': 'http.response.start', 'type': 'http.response.start',
'status': 200, 'status': 200,
'headers': [ 'headers': [
(b'Content-Type', b'text/css; charset=utf-8'), (b'Content-Type', b'text/css; charset=utf-8'),
(b'Content-Length', want_bytes(f'{len(resp_body)}')) (b'Content-Length', want_bytes(f'{os.path.getsize(path)}'))
] ]
}) })
async for chunk in _read_file(os.path.join(package_dir, result)):
await send({
'type': 'http.response.body',
'body': chunk
})
await self.app(scope, receive, send) await self.app(scope, receive, send)