libmagic
Sean Conner
sean at conman.org
Sat Nov 7 01:08:31 GMT 2020
It was thus said that the Great John Cowan once stated:
> This post is to suggest that servers currently using file extensions to
> determine MIME-types switch to libmagic.
The first Gemini server, GLV-1.12556, uses libmagic, and always has. I
consider that an implementation detail.
> Unfortunately, at the moment `file --mime` will report either "text/plain;
> charset=utf-8" or "text/plain; charset=us-ascii" instead of text/gemini.
> So an interesting question is: how can a text/gemini file best be
> identified by its content? It doesn't have to be infallible, because it can
> be backed up by checking the extension.
GLV-1.12556 allows one to specify MIME type by extension; if no such
information is available, it will then fall back to libmagic for the MIME
type. You can also spcify such an extension mapping for the entire server,
per host, per directory or per file [1].
-spc (You can check the sample-conf.lua file for more information [2])
[1] It also cascades---the various levels are merged at configuration
file to avoid processing overhead during normal operations.
[2] https://github.com/spc476/GLV-1.12556
More information about the Gemini
mailing list