Redirector handle by request url
All checks were successful
Build dev on push / build-redirector (push) Successful in 27s
Build dev on push / build-api (push) Successful in 29s
Build dev on push / build-web (push) Successful in 46s

This commit is contained in:
Sven Heidemann 2025-01-11 01:31:26 +01:00
parent 8d99cd5ccf
commit 854e00882b
2 changed files with 7 additions and 2 deletions

View File

@ -36,7 +36,12 @@ async def _handle_request(path: str):
domains = Environment.get("DOMAINS", list[str], []) domains = Environment.get("DOMAINS", list[str], [])
domain = await short_url.domain domain = await short_url.domain
if domain is not None and domain.name not in domains: logger.debug(f"Domain: {domain}, 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:
return render_template("404.html"), 404 return render_template("404.html"), 404
user_agent = request.headers.get("User-Agent", "").lower() user_agent = request.headers.get("User-Agent", "").lower()

View File

@ -1 +1 @@
1.2.1 1.2.2