From 3dd5357f243d9f89a8aa5a6279fc39f8b8c893f4 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Mon, 10 Nov 2025 16:47:35 +0300 Subject: [PATCH] [FIX] sometimes responses dont contain a _path reference --- app/library/HttpAPI.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/library/HttpAPI.py b/app/library/HttpAPI.py index f629d777..45a53f3a 100644 --- a/app/library/HttpAPI.py +++ b/app/library/HttpAPI.py @@ -262,8 +262,8 @@ class HttpAPI: response: Response = await handler(request) - contentType: str | None = response.headers.get("content-type", None) - if contentType and contentType.startswith("text/html"): + contentType: str = response.headers.get("content-type", "") + if contentType.startswith("text/html") and getattr(response, "_path", None): rewrite_path: str = base_path.rstrip("/") async with await anyio.open_file(response._path, "rb") as f: content = await f.read()