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

better mime type detection #203

Closed
Tracked by #173
Arqu opened this issue Aug 18, 2022 · 1 comment
Closed
Tracked by #173

better mime type detection #203

Arqu opened this issue Aug 18, 2022 · 1 comment

Comments

@Arqu
Copy link
Collaborator

Arqu commented Aug 18, 2022

Currently we do very simple extension/path based mime type detection. Usually that is not enough and we rely on clients and browsers to figure it out on their own.
We should do deeper inspection of the data to try and guess the correct mime type.
Kubo reference: https://github.com/ipfs/kubo/blob/9c6094e651bd30a11ee7a501bf9aa7eb5cc34deb/core/corehttp/gateway_handler_unixfs_file.go#L48

@fabricedesre
Copy link
Contributor

I don't know how good it is, but https://docs.rs/mime_classifier/0.0.1/mime_classifier/ could be used for that.

@Arqu Arqu closed this as completed Oct 14, 2022
@dignifiedquire dignifiedquire transferred this issue from n0-computer/iroh Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants