Skip to content

Commit

Permalink
Update hypercore-protocol-handlers.md (#49)
Browse files Browse the repository at this point in the history
Fix code snippet for hyper file upload
  • Loading branch information
tripledoublev authored Dec 8, 2023
1 parent f0a70a0 commit 48fd19d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/hypercore-protocol-handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -134,4 +134,4 @@ If it's a writable drive, data will be fully cleared. Attempting to write again

---

[Back](/)
[Back](/)

0 comments on commit 48fd19d

Please sign in to comment.