Skip to content

Commit

Permalink
Encode modified
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlee85 committed Mar 29, 2024
1 parent 579662f commit 46f8089
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ async function generateSignedUrl(request, key) {
const modifiedExpiryUrl = new URL(validUrl);
modifiedExpiryUrl.searchParams.set('expiry', `${expiry + 5}`);
const modifiedMacUrl = new URL(validUrl);
modifiedMacUrl.searchParams.set('mac', `${base64Mac}-bad-mac`);
modifiedMacUrl.searchParams.set(
'mac',
encodeURIComponent(`${base64Mac}-bad-mac`)
);

console.log('Valid URL:\n', validUrl);
console.log('Modified expiry URL:\n', modifiedExpiryUrl.toString());
Expand Down

0 comments on commit 46f8089

Please sign in to comment.