Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 9 additions & 2 deletions src/frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down