Fix image upload: use Tauri HTTP plugin to bypass WebView fetch restrictions

This commit is contained in:
Jure
2026-03-13 15:44:44 +01:00
parent 1d4ab27d08
commit 17304a2432
7 changed files with 472 additions and 14 deletions

View File

@@ -1,6 +1,8 @@
import { fetch } from "@tauri-apps/plugin-http";
/**
* Upload an image file to nostr.build and return the hosted URL.
* nostr.build offers free public image hosting for the Nostr ecosystem.
* Uses Tauri's HTTP plugin to bypass WebView CORS/fetch restrictions.
*/
export async function uploadImage(file: File): Promise<string> {
const form = new FormData();