@@ -47,6 +47,10 @@ def __init__(
4747 self .html_head = html_head or html .head ()
4848 self .html_lang = html_lang
4949
50+ def match_dispatch_path (self , scope : asgi_types .WebSocketScope ) -> bool :
51+ """Method override to remove `dotted_path` from the dispatcher URL."""
52+ return str (scope ["path" ]) == self .dispatcher_path
53+
5054
5155@dataclass
5256class ReactPyApp :
@@ -64,7 +68,7 @@ async def __call__(
6468 receive : asgi_types .ASGIReceiveCallable ,
6569 send : asgi_types .ASGISendCallable ,
6670 ) -> None :
67- if scope ["type" ] != "http" :
71+ if scope ["type" ] != "http" : # pragma: no cover
6872 if scope ["type" ] != "lifespan" :
6973 msg = (
7074 "ReactPy app received unsupported request of type '%s' at path '%s'" ,
@@ -120,18 +124,13 @@ async def __call__(
120124 headers = dict_to_byte_list (response_headers ),
121125 )
122126
123- def match_dispatch_path (self , scope : asgi_types .WebSocketScope ) -> bool :
124- """Method override to remove `dotted_path` from the dispatcher URL."""
125- return str (scope ["path" ]) == self .parent .dispatcher_path
126-
127127 def process_index_html (self ) -> None :
128128 """Process the index.html and store the results in memory."""
129129 self ._cached_index_html = (
130130 "<!doctype html>"
131131 f'<html lang="{ self .parent .html_lang } ">'
132132 f"{ vdom_head_to_html (self .parent .html_head )} "
133133 "<body>"
134- f'<div id="app"></div>'
135134 f"{ render_mount_template ('app' , '' , '' )} "
136135 "</body>"
137136 "</html>"
0 commit comments