mirror of
https://github.com/vector-im/element-web.git
synced 2025-09-12 17:21:10 +02:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
6fe889fae2
@ -39,9 +39,17 @@ function getRedactedHash(hash) {
|
|||||||
return hash.replace(hashRegex, "#/$1");
|
return hash.replace(hashRegex, "#/$1");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the current origin and hash separated with a `/`. This does not include query parameters.
|
// Return the current origin, path and hash separated with a `/`. This does
|
||||||
|
// not include query parameters.
|
||||||
function getRedactedUrl() {
|
function getRedactedUrl() {
|
||||||
const { origin, pathname, hash } = window.location;
|
const { origin, hash } = window.location;
|
||||||
|
let { pathname } = window.location;
|
||||||
|
|
||||||
|
// Redact paths which could contain unexpected PII
|
||||||
|
if (origin.startsWith('file://')) {
|
||||||
|
pathname = "/<redacted>/";
|
||||||
|
}
|
||||||
|
|
||||||
return origin + pathname + getRedactedHash(hash);
|
return origin + pathname + getRedactedHash(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user