Fix add port to TA_HOST parsing for cors

This commit is contained in:
MerlinScheurer 2025-01-26 20:22:52 +01:00
parent ffeb7cd95c
commit 641cc361a2

View File

@ -218,7 +218,13 @@ def ta_host_parser(ta_host: str) -> tuple[list[str], list[str]]:
parsed = urlparse(host_clean) parsed = urlparse(host_clean)
allowed_hosts.append(f"{parsed.hostname}") allowed_hosts.append(f"{parsed.hostname}")
csrf_trusted_origins.append(f"{parsed.scheme}://{parsed.hostname}")
cors_url = f"{parsed.scheme}://{parsed.hostname}"
if parsed.port:
cors_url = f"{cors_url}:{parsed.port}"
csrf_trusted_origins.append(cors_url)
return allowed_hosts, csrf_trusted_origins return allowed_hosts, csrf_trusted_origins