~sircmpwn/gmni-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH av98] add slash to end of url when going up a directory

Details
Message ID
<20210918180010.529243-1-jb55@jb55.com>
DKIM signature
missing
Download raw message
Patch: +1 -1
Some server software, such as gmnisrv, return "Not Found" when
requesting:

	gemini://jb55.com/log

instead of

	gemini://jb55.com/log/

This adds a forward slash to the route when going up a directory.

Signed-off-by: William Casarin <jb55@jb55.com>
---

Hey Solderpunk & gmnisrv devs,

I noticed the `up` functionality wasn't working in av98. Should this be
a fix in clients such as av98 or should gmnisrv work without ending
slashes on urls?

Cheers,
Will

 av98.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/av98.py b/av98.py
index f74b532..bad2c56 100755
--- a/av98.py
+++ b/av98.py
@@ -147,7 +147,7 @@ class GeminiItem():
            return self
        # Get rid of bottom component
        pathbits.pop()
        new_path = os.path.join(*pathbits)
        new_path = os.path.join(*pathbits) + "/"
        return GeminiItem(self._derive_url(new_path))

    def query(self, query):
-- 
2.32.0
Details
Message ID
<CED8N8ASY92D.37Z4FBO86BO7P@zach-macbookpro121>
In-Reply-To
<20210918180010.529243-1-jb55@jb55.com> (view parent)
DKIM signature
missing
Download raw message
On Sat Sep 18, 2021 at 11:00 AM EST, William Casarin wrote:
> Some server software, such as gmnisrv, return "Not Found" when
> requesting:
>
> 	gemini://jb55.com/log
>
> instead of
>
> 	gemini://jb55.com/log/
>
> I noticed the `up` functionality wasn't working in av98. Should this be
> a fix in clients such as av98

I would give an opinionated "Yes" to this question.
AFAIK, there's no specification for how "up" should work,
though since Mozz suggested it, taking hints from his server's implementation
might be a reasonable choice for client implementations.

gemini://mozz.us/journal/2021-01-01.gmi

(/journal redirects to /journal/, suggesting trailing slash should be used)

> or

(and/or)

> should gmnisrv work without ending slashes on urls?

In https://lists.sr.ht/~sircmpwn/gmni-devel/%3C20201219230730.3211241-1-zachdecook%40librem.one%3E
I suggest that we automatically add the trailing slash for autoindex
pages to work.

The link on this auto-indexed page doesn't work,
unless you load it with a trailing slash.

gemini://wiki.zachdecook.com/gemini-protocol

So, while the question could be framed
"should we deal bad client-implementations of an unspecified functionality",
I wouldn't see anything wrong with adding the redirect functionality
provided it doesn't interfere with cgi=on routes.

(the alternative solution for consistency would be
to make the previous link "51 Not Found" instead)

-Zach
Details
Message ID
<20210918190648.vjicq354ccr7ya4i@quiver>
In-Reply-To
<CED8N8ASY92D.37Z4FBO86BO7P@zach-macbookpro121> (view parent)
DKIM signature
missing
Download raw message
On Sat, Sep 18, 2021 at 02:55:33PM -0400, Zach DeCook wrote:
>On Sat Sep 18, 2021 at 11:00 AM EST, William Casarin wrote:
>> Some server software, such as gmnisrv, return "Not Found" when
>> requesting:
>>
>> 	gemini://jb55.com/log
>>
>> instead of
>>
>> 	gemini://jb55.com/log/
>>
>> I noticed the `up` functionality wasn't working in av98. Should this be
>> a fix in clients such as av98
>
>I would give an opinionated "Yes" to this question.
>AFAIK, there's no specification for how "up" should work,
>though since Mozz suggested it, taking hints from his server's implementation
>might be a reasonable choice for client implementations.

I noticed lagrange adds a slash as well. Although it's a pretty bad user
experience for people typing site.com/log manually, so perhaps there
should be a solution on the gmnisrv side regardless.

Cheers,
Will
Reply to thread Export thread (mbox)