1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Lookups are URL safe

This commit is contained in:
Travis Ralston
2019-08-21 14:30:24 -06:00
parent 3d5a79be3b
commit b306df726a

View File

@@ -1908,7 +1908,8 @@ MatrixBaseApis.prototype.identityHashedLookup = async function(
// Abuse the olm hashing
const olmutil = new global.Olm.Utility();
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];
return hashed;
});