Fix polynomial regex CodeQL warning

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-16 10:49:28 +04:00
parent 14d51b1fe4
commit cb438c010d

View File

@@ -72,7 +72,11 @@ export class CookieBannerClient {
private observer: MutationObserver | null = null;
constructor(config: CookieBannerClientOptions) {
this.baseUrl = config.baseUrl.replace(/\/+$/, "");
let base = config.baseUrl;
while (base.endsWith("/")) {
base = base.slice(0, -1);
}
this.baseUrl = base;
this.bannerId = config.bannerId;
this.visitorId = getOrCreateVisitorId(config.bannerId);
}