From 05b28dd0625b56618c2c75cb4788f474a022898a Mon Sep 17 00:00:00 2001 From: Ibrahim Awwad Date: Tue, 26 Nov 2024 11:28:18 +0200 Subject: [PATCH] add scheme to generated url (#25) --- src/charm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index e459621..0b96a93 100755 --- a/src/charm.py +++ b/src/charm.py @@ -604,7 +604,8 @@ def _sync_ingress_resources(self): def _generate_external_url(self, prefix: str) -> str: """Generate external URL for the ingress.""" - return f"http://{self._external_host}{prefix}" + scheme = "https" if self._construct_gateway_tls_secret() is not None else "http" + return f"{scheme}://{self._external_host}{prefix}" @property def _external_host(self) -> Optional[str]: