You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently at least nostrudel pastes the url field from the blob descriptor from an uploaded image directly into a nostr post. But nostr clients won't show an image when the URL doesn't end with an image extension such as jpeg, png, webp.
So from a usability point of view it would be useful if the blossom server added the extension. But this means that the server needs a map from upload MIME types to extensions, this isn't always straighforward.
Ostensibly, clients could also do this client-side (adding an extension is always allowed by the blossom protocol). And i imagine there are also non-nostr uses for blossom. So i'm not 100% sure this is a good thing to do server-side.
I think that makes perfectly sense, the server always has the context of the file so we could easily always serve with the filetype at the end. I don't think this breaks anything with the protocol so if you have any code for this, I'll happily review it. I can also try to add it after I get tests added (probably not this weekend).
Easiest would be to use the mime2ext crate. This is compiled from a static version of mime-db, so will include pretty much every possible file type. Alternatively, if you prefer not to add a dependency, we could use an hardcoded list of media mime types that people are likely to upload.
Currently at least nostrudel pastes the
url
field from the blob descriptor from an uploaded image directly into a nostr post. But nostr clients won't show an image when the URL doesn't end with an image extension such as jpeg, png, webp.So from a usability point of view it would be useful if the blossom server added the extension. But this means that the server needs a map from upload MIME types to extensions, this isn't always straighforward.
Ostensibly, clients could also do this client-side (adding an extension is always allowed by the blossom protocol). And i imagine there are also non-nostr uses for blossom. So i'm not 100% sure this is a good thing to do server-side.
BUD 2 doesn't specify this, currently. See also discussion in hzrd149/blossom#25 and hzrd149/blossom#26 .
The text was updated successfully, but these errors were encountered: