From 48fd19d374baa0f6f84ab3e59ae9a597b80e27cc Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 8 Dec 2023 10:19:55 -0500 Subject: [PATCH] Update hypercore-protocol-handlers.md (#49) Fix code snippet for hyper file upload --- docs/hypercore-protocol-handlers.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/hypercore-protocol-handlers.md b/docs/hypercore-protocol-handlers.md index f3c47d5..24b333b 100644 --- a/docs/hypercore-protocol-handlers.md +++ b/docs/hypercore-protocol-handlers.md @@ -84,8 +84,8 @@ async function uploadFile(files) { if (!response.ok) { addError(files, await response.text()); } - const urlResponse = protocol === 'hyper' ? response.url : response.headers.get('Location'); - addURL(urlResponse); + + addURL(response.url); } catch (error) { console.error(`Error uploading ${files}:`, error); } @@ -134,4 +134,4 @@ If it's a writable drive, data will be fully cleared. Attempting to write again --- -[Back](/) \ No newline at end of file +[Back](/)