From d3c315f64014182d5931bd53659d634272b2ffd5 Mon Sep 17 00:00:00 2001 From: William Chong Date: Tue, 28 Jan 2025 04:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20url=20escape=20for=20arwea?= =?UTF-8?q?ve=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/ui.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/ui.js b/utils/ui.js index 58d9d0d7..4bf043b4 100644 --- a/utils/ui.js +++ b/utils/ui.js @@ -52,7 +52,9 @@ export function formatIpfs(ipfsHash) { export function formatArweave(arweaveId, key) { if (key) { - return `ar://${arweaveId}?key=${key}` + const url = new URL(`ar://${arweaveId}`); + url.searchParams.append('key', key); + return url.toString(); } return `ar://${arweaveId}` }