diff --git a/htagweb/runners.py b/htagweb/runners.py index c4f8b66..2c6111f 100644 --- a/htagweb/runners.py +++ b/htagweb/runners.py @@ -199,7 +199,7 @@ def __init__(self, host="0.0.0.0", port=8000, debug:bool=False, - ssl:bool=False, + ssl:bool=False, # now, Indicate that Secure flag should be set for middleware WebServerSession (cookies) parano:bool=False, http_only:bool=False, timeout_interaction:int=60, @@ -207,7 +207,6 @@ def __init__(self, ): self.host=host self.port=port - self.ssl=ssl self.parano = parano self.http_only = http_only self.timeout_interaction = timeout_interaction @@ -226,7 +225,7 @@ def __init__(self, Starlette.__init__( self, debug=debug, routes=routes, - middleware=[Middleware(WebServerSession,https_only=self.ssl)], + middleware=[Middleware(WebServerSession,https_only=ssl)], lifespan=lifespan, ) @@ -272,6 +271,7 @@ async def handle(self, request, pparano="" + if is_http_only: # interactions use HTTP POST js = """%(jslib)s @@ -287,7 +287,7 @@ async def handle(self, request, """ % locals() else: # interactions use WS - protocol = "wss" if self.ssl else "ws" + protocol = "wss" if (request.url.scheme == "https") else "ws" js = """%(jslib)s