[spec] What to do of fragments when there is a redirection

Luke Emmet luke at marmaladefoo.com
Mon Dec 28 13:36:11 GMT 2020



On 28-Dec-2020 09:59, Solderpunk wrote:
> Okay, so original URL fragments should be carried over to redirect URLs
> if the redirect URL has no fragment (which I still suspect perhaps
> should be the only valid case).
Redirect URLs should not have a fragment as they specify a client side 
action. They wont be aware of the clients currently held fragment, so 
cannot act legitimately on it (for example to propose an alternative 
fragment). If they do have one, the client should strip it off, if they 
re-apply the previous fragment.

But frankly I'm skeptical it is a good semantics for a client to 
re-apply an old fragment on an out of date resource to a newly 
redirected resource. In my view they are attached only to the original 
URL and should not be replayed.

There are also some information leakage questions here of replaying 
fragments against new resources, but probably they arent too problematic 
in practice.

> What about queries?
>
> To some extent, the issue of a redirect URL having a query in it is
> similar to a link in a text/gemini document having a query in it, which
> was slightly controversial.  Not so much in the sense that people
> thought it should be disallowed, but that it was widely believed clients
> should handle such things very carefully and give the user a chance to
> confirm or edit the query string contents.
>
> Should redirect URLs be allowed to contain queries?
>
> If an original URL has a query in it but the client gets back a redirect
> URL without a query, should the original query be appended?

No, queries are very different to fragments which are client side. 
Queries are part of the server's URL space, like the path.

URLs with queries should not be adjusted by the client, unless in 
response to a user input.

A server may legitimately use these to implement various kinds of state 
- for example (in relation to another thread) the language partition of 
the application. For example I could implement a weather report in 
different languages thus:

gemini://server/weather/report?english

if the server implements a redirect to a new end point, it should do the 
work of appending any relevant parameterised query, thus:

31 gemini://server/weather/new-report?english

The client cannot know that the query would be valid against the target 
URL, and besides the target URL may already have a query on it, that the 
client should not strip off and replace with something else

  - Luke


More information about the Gemini mailing list