tower-web
tower-web copied to clipboard
Deducing the content type for files
If we're so inclined, we could read the first bytes of the file and use the mime_sniffer crate to and pick a content type automatically.
Alternatively, we could have an extension / MIME type mapping (mime_guess crate).
The playground guesses via filename, so I'm in favor. I had trouble trying to implement this in a reusable manner, however (although I don't remember why).
I am also in favor of supporting this 👍