diff --git a/server.py b/server.py index a7915bd..69ea9fe 100644 --- a/server.py +++ b/server.py @@ -96,6 +96,8 @@ def inst(s): cache[s]=x.http_app(path="/mcp",transport="streamable-http",stateless_http=True);return cache[s] class Router: async def __call__(self,scope,receive,send): + if scope.get("type")=="lifespan": + await mgmt(scope,receive,send);return h=dict(scope.get("headers",[])).get(b"host",b"").decode().split(":")[0].lower();p=scope.get("path","/") if h=="my.phast.app":await mgmt(scope,receive,send);return if h.endswith(".phast.app"):