khatru/blossom: get rid of custom BlobDescriptor with useless Owner field.

This commit is contained in:
fiatjaf
2026-01-13 00:03:49 -03:00
parent 14acd4b740
commit b9f1f93561
4 changed files with 24 additions and 34 deletions

View File

@@ -36,11 +36,7 @@ func (bs BlossomServer) handleUploadCheck(w http.ResponseWriter, r *http.Request
}
mimetype := r.Header.Get("X-Content-Type")
exts, _ := mime.ExtensionsByType(mimetype)
var ext string
if len(exts) > 0 {
ext = exts[0]
}
ext := blossom.GetExtension(mimetype)
// get the file size from the incoming header
size, _ := strconv.Atoi(r.Header.Get("X-Content-Length"))
@@ -135,7 +131,7 @@ func (bs BlossomServer) handleUpload(w http.ResponseWriter, r *http.Request) {
}
// keep track of the blob descriptor
bd := BlobDescriptor{
bd := blossom.BlobDescriptor{
URL: bs.ServiceURL + "/" + hhash + ext,
SHA256: hhash,
Size: len(b),
@@ -472,7 +468,7 @@ func (bs BlossomServer) handleMirror(w http.ResponseWriter, r *http.Request) {
}
// keep track of the blob descriptor
bd := BlobDescriptor{
bd := blossom.BlobDescriptor{
URL: bs.ServiceURL + "/" + hhash + ext,
SHA256: hhash,
Size: len(body),