You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Lookups are URL safe
This commit is contained in:
@@ -1908,7 +1908,8 @@ MatrixBaseApis.prototype.identityHashedLookup = async function(
|
|||||||
// Abuse the olm hashing
|
// Abuse the olm hashing
|
||||||
const olmutil = new global.Olm.Utility();
|
const olmutil = new global.Olm.Utility();
|
||||||
params["addresses"] = addressPairs.map(p => {
|
params["addresses"] = addressPairs.map(p => {
|
||||||
const hashed = olmutil.sha256(`${p[0]} ${p[1]} ${params['pepper']}`);
|
const hashed = olmutil.sha256(`${p[0]} ${p[1]} ${params['pepper']}`)
|
||||||
|
.replace(/\+/g, '-').replace(/\//g, '_'); // URL-safe base64
|
||||||
localMapping[hashed] = p[0];
|
localMapping[hashed] = p[0];
|
||||||
return hashed;
|
return hashed;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user