dont use lookbehind in regular expressions, safari & older firefoxes choke on them

This commit is contained in:
Bruno Windels 2021-12-08 18:00:27 +01:00
parent c87628b614
commit c8b0354d07
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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=).+/, "<snip>");
item.e.stack = item.e.stack.replace(/(?<=\/\?loginToken=).+/, "?loginToken=<snip>");
}
return item;
};