From 8f77c3f7bf6e289eb1cea7170374ad790011137e Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Tue, 10 Jan 2023 16:49:36 +0200 Subject: [PATCH] fix: handle no-path scenario --- lnbits/helpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lnbits/helpers.py b/lnbits/helpers.py index 86cf8a92..a9e583a7 100644 --- a/lnbits/helpers.py +++ b/lnbits/helpers.py @@ -106,6 +106,10 @@ class InstalledExtensionMiddleware: self.app = app async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: + if not "path" in scope: + await self.app(scope, receive, send) + return + path_elements = scope["path"].split("/") if len(path_elements) > 2: _, path_name, path_type, *rest = path_elements