change sso port to be optional

request.url.port can return None in the case of default ports (80,443)

Change-Id: I07b5fdf11199afefd2996ff36c6e997e52037308
Signed-off-by: Danny Webb <danny.webb@thehutgroup.com>
This commit is contained in:
Danny Webb 2023-04-04 16:19:49 +01:00
parent 8d85cacab8
commit de22d3ba3b

View File

@ -207,7 +207,8 @@ async def get_sso(request: Request) -> schemas.SSO:
ks_url = CONF.openstack.keystone_url.rstrip("/")
url_scheme = "https" if CONF.default.ssl_enabled else "http"
base_url = f"{url_scheme}://{request.url.hostname}:{request.url.port}"
port = f":{request.url.port}" if request.url.port else ""
base_url = f"{url_scheme}://{request.url.hostname}{port}"
base_path = str(PurePath("/").joinpath(CONF.openstack.nginx_prefix, "skyline"))
for protocol in CONF.openstack.sso_protocols: