diff --git a/client/src/utils/FileUpload.tsx b/client/src/utils/FileUpload.tsx index 2dcdd78..58abf14 100644 --- a/client/src/utils/FileUpload.tsx +++ b/client/src/utils/FileUpload.tsx @@ -19,26 +19,28 @@ export default async function FileUpload(file: File): Promise { const authEvent = { kind: 27235, tags: [ - ["u", "https://void.cat/upload"], + ["u", "https://files.v0l.io/upload"], ["method", "POST"] ], content: "", created_at: Math.floor(Date.now() / 1000), pubkey: getPublicKey(sk), } - return `Nostr ${base64.encode(new TextEncoder().encode(JSON.stringify(finalizeEvent(authEvent, sk))))}`; + const authString = JSON.stringify(finalizeEvent(authEvent, sk)); + const authBase64 = base64.encode(new TextEncoder().encode(authString)); + return `Nostr ${authBase64}`; }; - const req = await fetch("https://void.cat/upload", { + const req = await fetch("https://files.v0l.io/upload", { body: buf, method: "POST", headers: { "Content-Type": "application/octet-stream", - "V-Content-Type": file.type, // Extracting the mime type - "V-Filename": file.name, // Extracting the filename + "V-Content-Type": encodeURIComponent(file.type), + "V-Filename": encodeURIComponent(file.name), "V-Description": "Upload from https://tao-green.vercel.app/", - "V-Strip-Metadata": "true", // Here's the new header - "authorization": await auth() + "V-Strip-Metadata": "true", + "authorization": await auth() // Use the encoded authorization header }, }); if (req.ok) { diff --git a/client/src/utils/relays.ts b/client/src/utils/relays.ts index a59c670..a250f2f 100644 --- a/client/src/utils/relays.ts +++ b/client/src/utils/relays.ts @@ -11,7 +11,7 @@ type Subscribe = { unsub?: boolean; }; -const blacklistUrl = ["lain.la", "casualcrypto.date"]; +const blacklistUrl = ["lain.la", "casualcrypto.date", "files.catbox.moe"]; const subList: Array = []; const currentSubList: Array = [];