blossom: send content-type header when uploading.

This commit is contained in:
fiatjaf
2026-07-13 22:28:19 -03:00
parent 514678b102
commit b1406da48e
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@nostr/tools",
"version": "2.23.11",
"version": "2.23.12",
"exports": {
".": "./index.ts",
"./core": "./core.ts",
+4 -1
View File
@@ -393,7 +393,10 @@ export async function uploadBlob(server: string, blob: Blob | File, opts?: Uploa
const url = new URL('/upload', server).toString()
const sha256 = await computeBlobSha256(blob)
const headers: Record<string, string> = { 'X-SHA-256': sha256 }
const headers: Record<string, string> = {
'X-SHA-256': sha256,
'Content-Type': getBlobType(blob) || 'application/octet-stream',
}
if (opts?.auth) {
const authEvent = typeof opts.auth === 'boolean' ? await opts.onAuth?.(server, sha256) : opts.auth
+1 -1
View File
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "nostr-tools",
"version": "2.23.11",
"version": "2.23.12",
"description": "Tools for making a Nostr client.",
"repository": {
"type": "git",