fix: nip96 upload

fix: leaky file handles
This commit is contained in:
2024-11-29 23:41:47 +00:00
parent c8308f0003
commit 5bebb71f4d
5 changed files with 6 additions and 6 deletions

View File

@ -32,7 +32,7 @@ export class Nip96 {
const fd = new FormData();
fd.append("size", file.size.toString());
fd.append("caption", file.name);
fd.append("media_type", file.type);
fd.append("content_type", file.type);
fd.append("file", file);
const rsp = await this.#req("", "POST", fd);

View File

@ -23,8 +23,7 @@ export default function Upload() {
const login = useLogin();
const pub = usePublisher();
const url = `${location.protocol}//${location.host}`;
//const url = "http://localhost:8000";
const url = import.meta.env.VITE_API_URL || `${location.protocol}//${location.host}`;
async function doUpload() {
if (!pub) return;
if (!toUpload) return;