Skip to content

Commit 8d78052

Browse files
committed
fixed http/https
1 parent 03986ec commit 8d78052

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

kubernetes/opentelemetry-demo.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,10 +2491,18 @@ data:
24912491
24922492
function buildBaseUrl() {
24932493
const raw = (process.env.RUM_FRONTEND_IP || '').trim();
2494-
const base = raw ? (/^https?:\/\//i.test(raw) ? raw : `http://${raw}`) : 'http://localhost';
2495-
return base.replace(/\/+$/, '') + '/';
2496-
}
24972494
2495+
// If it's empty, default to localhost
2496+
if (!raw) return 'https://localhost/';
2497+
2498+
// If it already starts with http:// or https://, keep it exactly as-is
2499+
if (/^https?:\/\//i.test(raw)) {
2500+
return raw.replace(/\/+$/, '') + '/';
2501+
}
2502+
2503+
// Otherwise, prepend https://
2504+
return `https://${raw.replace(/\/+$/, '')}/`;
2505+
}
24982506
function delay(ms) { return new Promise(res => setTimeout(res, ms)); }
24992507
25002508
/** Wait until innerText of the page contains a substring */

0 commit comments

Comments
 (0)