This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Storing Explicit Content Type #11
Labels
Comments
Closed
Yes. The idea is that users would be able to add arbitrary custom attributes/metadata (even custom links to other objects). |
This was referenced Aug 7, 2018
27 tasks
Closed
This was referenced Aug 12, 2019
22 tasks
2 tasks
closing for archival |
7 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For some reason I was under impression unixfs-v2 has an option to set explicit content-type (aka mime/media-type) that travels along with data, but I did not found any discussion (cc #1 #10) about it.
My working assumption is that one could store it as one of optional "Extended Attributes", as noted in #2.
Is this assumption correct?
If not, what is the current line of thought when it comes to media types and IPFS?
Digression On Ambiguous Bytes
Depending on assumed content-type, the meaning and presentation of specific types of data may change drastically, breaking UX assumption made by the original author.
There are other examples floating around, but a poster child for storing explicit content-type for some types of content is SVG (
image/svg+xml
).It produced issues every now and then by being mime-sniffed incorrectly:
I am working on custom protocol handler in web browsers, and noticed edge cases where it would be really beneficial to have an option to provide own media type with media itself and avoid media type sniffing, be it userland javascript or the browser itself. Same goes for HTTP gateway in go-ipfs: it could take advantage of additional media type metadata (if present) and set proper Content-Type header without relying on net/http/sniff.go. There are security contexts in which it makes sense to set
X-Content-Type-Options: nosniff
and AFAIK right now we don't have any good answer for that. Supporting media type as optional value in unixfs-v2 could be a viable one.The text was updated successfully, but these errors were encountered: