Skip to content

Commit

Permalink
add scheme to generated url (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
IbraAoad authored Nov 26, 2024
1 parent d9a1fc0 commit 05b28dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 05b28dd

Please sign in to comment.