fix(blossom): remove extra . when serving files without extension

Ensure the correct filename is constructed when serving content without
an extension
This commit is contained in:
Anthony Accioly
2025-05-12 23:53:01 +01:00
committed by fiatjaf_
parent b2607e787f
commit 5705647c6b

View File

@@ -220,7 +220,11 @@ func (bs BlossomServer) handleGetBlob(w http.ResponseWriter, r *http.Request) {
}
w.Header().Set("ETag", hhash)
w.Header().Set("Cache-Control", "public, max-age=604800, immutable")
http.ServeContent(w, r, hhash+"."+ext, t, reader)
name := hhash
if ext != "" {
name += "." + ext
}
http.ServeContent(w, r, name, t, reader)
return
}
}