Skip to content

Commit

Permalink
Avoid exceptions in ASGI HTTPFile response in case of missing scope…
Browse files Browse the repository at this point in the history
… extensions
  • Loading branch information
gi0baro committed Jan 28, 2024
1 parent f14ae93 commit 7a3fec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emmett/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def asgi(self, scope, send):
return
self._headers.update(self._get_stat_headers(stat_data))
await self._send_headers(send)
if 'http.response.pathsend' in scope['extensions']:
if 'http.response.pathsend' in scope.get('extensions', {}):
await send({
'type': 'http.response.pathsend',
'path': str(self.file_path)
Expand Down

0 comments on commit 7a3fec0

Please sign in to comment.