diff --git a/CHANGELOG.md b/CHANGELOG.md index 4878ea51..1a33e5d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## next - Fixed extra params encoding on `report` page +- Added base64 encoding/decoding for extra params when parameter name ends with `-b64` on `report` page ## 1.0.0-beta.55 (17-02-2021) diff --git a/src/pages/report/params.js b/src/pages/report/params.js index 784a5f1f..72be6e57 100644 --- a/src/pages/report/params.js +++ b/src/pages/report/params.js @@ -31,7 +31,10 @@ export function encodeParams(params) { Object.keys(extra || {}).sort().forEach(name => { if (!specialParams.includes(name)) { - pairs.push([name, extra[name]]); + pairs.push([name, name.endsWith('-b64') && typeof extra[name] === 'string' + ? base64.encode(extra[name]) + : extra[name] + ]); } }); @@ -51,7 +54,9 @@ export function decodeParams(pairs) { Object.keys(params).forEach(name => { if (!specialParams.includes(name)) { - decodedParams[name] = params[name]; + decodedParams[name] = name.endsWith('-b64') && typeof params[name] === 'string' + ? base64.decode(params[name]) + : params[name]; } });