diff --git a/CHANGELOG.md b/CHANGELOG.md index 23c53b3f08..40a7b61d10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ the release. ([#1610](https://github.com/open-telemetry/opentelemetry-demo/pull/1610)) * [Valkey] Replace Redis with Valkey ([#1619](https://github.com/open-telemetry/opentelemetry-demo/pull/1619)) +* [frontend] fixed default flagd port for HTTPS connections + ([#1609](https://github.com/open-telemetry/opentelemetry-demo/pull/1609)) ## 1.10.0 diff --git a/src/frontend/pages/_app.tsx b/src/frontend/pages/_app.tsx index 00a7e696b5..e49b51f7c6 100755 --- a/src/frontend/pages/_app.tsx +++ b/src/frontend/pages/_app.tsx @@ -37,12 +37,19 @@ if (typeof window !== 'undefined') { * We connect to flagd through the envoy proxy, straight from the browser, * for this we need to know the current hostname and port. */ + + const useTLS = window.location.protocol === 'https:'; + let port = useTLS ? 443 : 80; + if (window.location.port) { + port = parseInt(window.location.port, 10); + } + OpenFeature.setProvider( new FlagdWebProvider({ host: window.location.hostname, pathPrefix: 'flagservice', - port: window.location.port ? parseInt(window.location.port, 10) : 80, - tls: window.location.protocol === 'https:', + port: port, + tls: useTLS, maxRetries: 3, maxDelay: 10000, })