We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11ef3c6 commit d63ad75Copy full SHA for d63ad75
src/frontend/pages/_app.tsx
@@ -37,12 +37,19 @@ if (typeof window !== 'undefined') {
37
* We connect to flagd through the envoy proxy, straight from the browser,
38
* for this we need to know the current hostname and port.
39
*/
40
+
41
+ const useTLS = window.location.protocol === 'https:';
42
+ let port = useTLS ? 443 : 80;
43
+ if (window.location.port) {
44
+ port = parseInt(window.location.port, 10);
45
+ }
46
47
OpenFeature.setProvider(
48
new FlagdWebProvider({
49
host: window.location.hostname,
50
pathPrefix: 'flagservice',
- port: window.location.port ? parseInt(window.location.port, 10) : 80,
- tls: window.location.protocol === 'https:',
51
+ port: port,
52
+ tls: useTLS,
53
maxRetries: 3,
54
maxDelay: 10000,
55
})
0 commit comments