From c8b0354d0774dd11dc0311a39ed079e5aac3aed2 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 8 Dec 2021 18:00:27 +0100 Subject: [PATCH] dont use lookbehind in regular expressions, safari & older firefoxes choke on them --- codestyle.md | 2 ++ src/platform/web/Platform.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/codestyle.md b/codestyle.md index c0e0e363..656a6845 100644 --- a/codestyle.md +++ b/codestyle.md @@ -8,3 +8,5 @@ otherwise it becomes hard to remember what was a default/named export - should we return promises from storage mutation calls? probably not, as we don't await them anywhere. only read calls should return promises? - we don't anymore + - don't use these features, as they are not widely enough supported. + - [lookbehind in regular expressions](https://caniuse.com/js-regexp-lookbehind) diff --git a/src/platform/web/Platform.js b/src/platform/web/Platform.js index 787c1c90..78332e59 100644 --- a/src/platform/web/Platform.js +++ b/src/platform/web/Platform.js @@ -163,7 +163,7 @@ export class Platform { // Make sure that loginToken does not end up in the logs const transformer = (item) => { if (item.e?.stack) { - item.e.stack = item.e.stack.replace(/(?<=\/\?loginToken=).+/, ""); + item.e.stack = item.e.stack.replace(/(?<=\/\?loginToken=).+/, "?loginToken="); } return item; };