Skip to content

Commit

Permalink
Handle ASGI lifespan when running with a secondary ASGI app (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
mozartilize committed Jul 1, 2022
1 parent d3a23c0 commit c4a021e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/engineio/async_drivers/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ async def __call__(self, scope, receive, send):
else:
static_file = get_static_file(scope['path'], self.static_files) \
if scope['type'] == 'http' and self.static_files else None
if static_file and os.path.exists(static_file['filename']):
if scope['type'] == 'lifespan':
await self.lifespan(receive, send)
elif static_file and os.path.exists(static_file['filename']):
await self.serve_static_file(static_file, receive, send)
elif self.other_asgi_app is not None:
await self.other_asgi_app(scope, receive, send)
elif scope['type'] == 'lifespan':
await self.lifespan(receive, send)
else:
await self.not_found(receive, send)

Expand Down

0 comments on commit c4a021e

Please sign in to comment.