Illusory latency due to trailing slash redirects

Philip Linde linde.philip at gmail.com
Sat Jun 27 10:42:39 BST 2020


> I'm pretty sure it should be safe for clients to automatically append
> trailing slashes to URLs without paths.

Indeed it should be, per rfc3986:

> In general, a URI that uses the generic syntax for authority with
> an empty path should be normalized to a path of "/".

An authority in this context is //[<user>[:<password>]@]<host>[:<port>],
so "gemini://example.horse" and "gemini://example.horse/" are
equivalent in a strictly compliant rfc3986 implementation.

A server that serves different content on //server and //server/ can be
a huge pain in the neck. When I wrote my dillo plugin I noticed that it
seems to apply this normalization in reverse before the URL is handed
to the plugin. So "gemini://example.horse/" could only be seen on the
plugin end as "gemini://example.horse", which also makes redirects to
"gemini://example.horse/" loop back to "gemini://example.horse/".
Redirect hell ensued!

That Dillo does this might be strange, but absolutely fine from a
standards perspective. It's the server that's not compliant.

-- 
Philip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <https://lists.orbitalfox.eu/archives/gemini/attachments/20200627/627e8733/attachment.sig>


More information about the Gemini mailing list