diff --git a/pystream/__init__.py b/pystream/__init__.py index b24a3b7..051d5f9 100644 --- a/pystream/__init__.py +++ b/pystream/__init__.py @@ -2,4 +2,4 @@ from .main import start # noqa: F401 from .models import config, images, secure # noqa: F401 -version = "2.0" +version = "2.1" diff --git a/pystream/main.py b/pystream/main.py index b5b836e..64e36db 100644 --- a/pystream/main.py +++ b/pystream/main.py @@ -37,7 +37,7 @@ async def redirect_exception_handler(request: Request, else: response = RedirectResponse(url=exception.location) if exception.detail: - response.set_cookie("detail", exception.detail.upper()) + response.set_cookie("detail", exception.detail.upper(), httponly=True, samesite="strict") return response diff --git a/pystream/routers/auth.py b/pystream/routers/auth.py index f560b6f..6964a75 100644 --- a/pystream/routers/auth.py +++ b/pystream/routers/auth.py @@ -71,7 +71,8 @@ async def login(request: Request) -> JSONResponse: value=config.static.cipher_suite.encrypt(str(auth_payload).encode("utf-8")).decode(), max_age=config.env.session_duration, expires=expiration, - httponly=True) + httponly=True, + samesite="strict") if config.env.secure_session: cookie_kwargs["secure"] = True response.set_cookie(**cookie_kwargs) diff --git a/pystream/routers/video.py b/pystream/routers/video.py index fc1662c..efc1e51 100644 --- a/pystream/routers/video.py +++ b/pystream/routers/video.py @@ -95,7 +95,7 @@ async def stream_video(request: Request, ) if pure_path.exists(): attrs = { - "request": request, "video_title": video_path, + "request": request, "video_title": pure_path.name, "home": config.static.home_endpoint, "logout": config.static.logout_endpoint, "path": f"{config.static.streaming_endpoint}?{config.static.query_param}={urlparse.quote(str(pure_path))}" } diff --git a/pystream/templates/land.html b/pystream/templates/land.html index 0e19850..659d498 100644 --- a/pystream/templates/land.html +++ b/pystream/templates/land.html @@ -3,7 +3,7 @@ - FastAPI video streaming + {{ video_title }}