From 745b3027e4bcce0403fdf293612e445d0ce6538d Mon Sep 17 00:00:00 2001 From: Francisco Veiga Date: Mon, 15 Jun 2026 15:59:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20[RUM-16634]=20Require=20WebView?= =?UTF-8?q?=20wildcard=20to=20match=20at=20least=20one=20character?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/browser-core/src/transport/eventBridge.spec.ts | 4 ++++ packages/browser-core/src/transport/eventBridge.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/browser-core/src/transport/eventBridge.spec.ts b/packages/browser-core/src/transport/eventBridge.spec.ts index a719977ee3..043e58326f 100644 --- a/packages/browser-core/src/transport/eventBridge.spec.ts +++ b/packages/browser-core/src/transport/eventBridge.spec.ts @@ -50,6 +50,10 @@ describe('matchesHostEntry', () => { ['evil.com', '*.shopist.io', false], ['app.shopist.io.evil.com', '*.shopist.io', false], ['anything.foo.anything.bar', '*.foo.*.bar', false], // multiple wildcards → invalid + ['preview-.shopist.io', 'preview-*.shopist.io', false], // wildcard must match at least one character + ['.shopist.io', '*.shopist.io', false], // wildcard must match at least one character + ['app.shopist.io', '*', true], // bare "*" matches any host + ['shopist.io', '*', true], // bare "*" matches any host ] cases.forEach(([host, pattern, expected]) => { diff --git a/packages/browser-core/src/transport/eventBridge.ts b/packages/browser-core/src/transport/eventBridge.ts index 8372efd3a9..7e2d2f0bff 100644 --- a/packages/browser-core/src/transport/eventBridge.ts +++ b/packages/browser-core/src/transport/eventBridge.ts @@ -65,7 +65,7 @@ export function matchesHostEntry(host: string, entry: string): boolean { return false } const [prefix, suffix] = parts - return host.length >= prefix.length + suffix.length && host.startsWith(prefix) && host.endsWith(suffix) + return host.length > prefix.length + suffix.length && host.startsWith(prefix) && host.endsWith(suffix) } function getEventBridgeGlobal() {