From 1b63a9b729cb8203d906701530a2d9956cb70aed Mon Sep 17 00:00:00 2001 From: edraft Date: Thu, 16 Jan 2025 17:11:28 +0100 Subject: [PATCH] Should fix redirector --- api/src/redirector.py | 4 ++-- version.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/redirector.py b/api/src/redirector.py index 66beee2..79b1e09 100644 --- a/api/src/redirector.py +++ b/api/src/redirector.py @@ -36,12 +36,12 @@ async def _handle_request(path: str): domains = Environment.get("DOMAINS", list[str], []) domain = await short_url.domain - logger.debug(f"Domain: {domain}, request.host: {request.host}") + logger.debug(f"Domain: {domain.name}, request.host: {request.host}") host = request.host if ":" in host: host = host.split(":")[0] - if host not in domains or domain is not None and domain.name not in domains: + if domain is None or domain.name not in domains and not host.endswith(domain.name): return render_template("404.html"), 404 user_agent = request.headers.get("User-Agent", "").lower() diff --git a/version.txt b/version.txt index e2cac26..b966e81 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.2.3 \ No newline at end of file +1.2.4 \ No newline at end of file