~sircmpwn/gmni-discuss

3 2

Case sensitivity in hostnames for vhosts

Details
Message ID
<c49ae82c-f6e9-5ac9-80a8-cdf3f7dc5e9e@tomasino.org>
DKIM signature
pass
Download raw message
It appears that hostnames configured as virtual hosts with gmnisrv are
case-sensitive. Since DNS hostnames are case insensitive I would have
expected gmnisrv to lowercase-ify incoming requests prior to matching
the directives in the INI file.

To test this I attempted to load gemini://gopher.black (which uses
gmnisrv) and gemini://GOPHER.BLACK via a variety of clients. Some
clients handle lowercasifying the request on their end, but many do not.
Amfora is a good example. Use that returns either the correct gemini
site or Proxy Request Refused in the case of the capitalized version.
Details
Message ID
<CFQHL3XRSIER.2MHLD6IW7VMTG@taiga>
In-Reply-To
<c49ae82c-f6e9-5ac9-80a8-cdf3f7dc5e9e@tomasino.org> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Yeah, this seems like a legitimate bug. Patches welcome.
Details
Message ID
<ac7109c4-6e70-cd53-bd54-3c0af60e3139@tomasino.org>
In-Reply-To
<CFQHL3XRSIER.2MHLD6IW7VMTG@taiga> (view parent)
DKIM signature
pass
Download raw message
I've not touched C much in 20 years, but I grabbed the source thinking
this should be an
easy fix. "Proxy Request Refused" is response code 53. I see it defined
in the source as
GEMINI_STATUS_PROXY_REQUEST_REFUSED, but the only reference is in
serve.c where
the error message is "Refusing proxy to non-gemini URL". Based on the
code I would have
expected this to hit the "Protocol error: hostname does not match SNI"
block and given
a GEMINI_STATUS_BAD_REQUEST response instead of the 53 I'm seeing.

I'm guessing I'm just not following the logic as to what's going on
here. I'm sure it's an
easy patch for someone a bit more versed in the language.
Details
Message ID
<CFQI0GM398PV.17UWJSHPBMCL5@taiga>
In-Reply-To
<ac7109c4-6e70-cd53-bd54-3c0af60e3139@tomasino.org> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
It's an easy patch for you, too.
Reply to thread Export thread (mbox)