mirror of
https://github.com/smolgrrr/TAO.git
synced 2024-09-20 09:21:25 +00:00
more censorship
This commit is contained in:
parent
af9d99b8ee
commit
139e0d6914
@ -19,26 +19,28 @@ export default async function FileUpload(file: File): Promise<UploadResult> {
|
|||||||
const authEvent = {
|
const authEvent = {
|
||||||
kind: 27235,
|
kind: 27235,
|
||||||
tags: [
|
tags: [
|
||||||
["u", "https://void.cat/upload"],
|
["u", "https://files.v0l.io/upload"],
|
||||||
["method", "POST"]
|
["method", "POST"]
|
||||||
],
|
],
|
||||||
content: "",
|
content: "",
|
||||||
created_at: Math.floor(Date.now() / 1000),
|
created_at: Math.floor(Date.now() / 1000),
|
||||||
pubkey: getPublicKey(sk),
|
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,
|
body: buf,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/octet-stream",
|
"Content-Type": "application/octet-stream",
|
||||||
"V-Content-Type": file.type, // Extracting the mime type
|
"V-Content-Type": encodeURIComponent(file.type),
|
||||||
"V-Filename": file.name, // Extracting the filename
|
"V-Filename": encodeURIComponent(file.name),
|
||||||
"V-Description": "Upload from https://tao-green.vercel.app/",
|
"V-Description": "Upload from https://tao-green.vercel.app/",
|
||||||
"V-Strip-Metadata": "true", // Here's the new header
|
"V-Strip-Metadata": "true",
|
||||||
"authorization": await auth()
|
"authorization": await auth() // Use the encoded authorization header
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (req.ok) {
|
if (req.ok) {
|
||||||
|
@ -11,7 +11,7 @@ type Subscribe = {
|
|||||||
unsub?: boolean;
|
unsub?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const blacklistUrl = ["lain.la", "casualcrypto.date"];
|
const blacklistUrl = ["lain.la", "casualcrypto.date", "files.catbox.moe"];
|
||||||
|
|
||||||
const subList: Array<Subscription> = [];
|
const subList: Array<Subscription> = [];
|
||||||
const currentSubList: Array<Subscribe> = [];
|
const currentSubList: Array<Subscribe> = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user