~sircmpwn/gmni#55: 
MIME types of extensionless documents

Hello, When I want to access to a page without .gmi extention, gmnisrv serves it as binary content, which isn't rendered by browsers. I can see why, but I thing this is problematic in some cases.

AFAIC I serve a gemini version of my http blog, which URLs are without extension. So, to make minimum efforts to convert http to gemini URLs, I would like my gemini URLs not to have extension as well.

So in my opinion there would be 2 options:

  • a configuration option to tell the server that everything in a given folder (or except in a given folder) should be served as text/gemini
  • a configuration option to tell that URL path /example/file should match filesystem path /example/file.gmi

Thanks for your attention.

Status
REPORTED
Submitter
~raspbeguy
Assigned to
No-one
Submitted
8 months ago
Updated
8 months ago
Labels
No labels applied.

~sircmpwn 8 months ago

Something like the following would be agreeable to me:

ext:foo=text/gemtext
ext:=text/plain

~raspbeguy 8 months ago*

If I understand correctly, you propose to specify in config file how to match the MIME type with file extension. In my case that could work, but maybe that wouldn't be such a great idea. If people have GMI files without extensions AND for example some compiled binary programs (without extension), that wouldn't work.

~sircmpwn 8 months ago

You could just use more specific routing to address different kinds of files which cannot be matched solely based on extension.

~raspbeguy 8 months ago

Depends, do you plan to make this setting virtualhost-specific or folder-specific or something else ?

~sircmpwn 8 months ago

Route-specific. You should read the gmnisrv.ini(5) man page.

~raspbeguy 8 months ago

Oh I see, for some reason my man page was truncated and didn't show the full route section. Probably due to compilation error :

# make docs
SCDOC	doc/gmnisrv.1
SCDOC	doc/gmnisrvini.5
Error at 57:2: Expected one of '[', '-', ']', or ' '
make: *** [Makefile:29: doc/gmnisrvini.5] Error 1

~sircmpwn 8 months ago

What version of scdoc do you have intsalled? It's probably outdated.

~raspbeguy 8 months ago

1.9.0, this is the version in current debian stable repositories.

~sircmpwn 8 months ago

Yeah, the latest is 1.11.0.

~raspbeguy 8 months ago

Ok.

Well, that's very useful, I didn't know about the routing feature. In those conditions I think your proposition should cover a fairly high number of use cases.

Register here or Log in to comment, or comment via email.