Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Storing Explicit Content Type #11

Closed
lidel opened this issue Aug 7, 2018 · 2 comments
Closed

Storing Explicit Content Type #11

lidel opened this issue Aug 7, 2018 · 2 comments

Comments

@lidel
Copy link

lidel commented Aug 7, 2018

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.

@lidel lidel mentioned this issue Aug 7, 2018
@Stebalien
Copy link

Yes. The idea is that users would be able to add arbitrary custom attributes/metadata (even custom links to other objects).

@rvagg
Copy link
Member

rvagg commented Dec 6, 2022

closing for archival

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants