diff --git a/app/portainer/helpers/webhookHelper.ts b/app/portainer/helpers/webhookHelper.ts index 82fe54c86..a6dc7fb49 100644 --- a/app/portainer/helpers/webhookHelper.ts +++ b/app/portainer/helpers/webhookHelper.ts @@ -42,7 +42,8 @@ function getBaseUrl() { const port = parseInt(window.location.port, 10); const displayPort = (protocol === 'http' && port === 80) || - (protocol === 'https' && port === 443) + (protocol === 'https' && port === 443) || + Number.isNaN(port) ? '' : `:${port}`; return `${protocol}://${hostname}${displayPort}${baseHref()}`;