💾 Archived View for rawtext.club › ~sloum › geminilist › 003096.gmi captured on 2020-11-07 at 03:21:15. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

<-- back to the mailing list

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. Iconsider 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 suchinformation is available, it will then fall back to libmagic for the MIMEtype. 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