💾 Archived View for bbs.geminispace.org › u › mbays › 11298 captured on 2024-05-12 at 18:54:41. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-05-10)
-=-=-=-=-=-=-
@skyjake It looks to me like lagrange is considering the empty query as a special case, while in the gemini protocol itself it is not special -- the empty string is just one possibility for the query string.
2023-10-29 · 6 months ago
🕹️ skyjake [OP/mod...] · 2023-10-30 at 12:31:
I don't think the protocol comes into play here. I thought on this a bit more and came away with the following. The user is applying a behavioral rule for opening a link in their client. Currently in Lagrange it is:
To work with Gemkerkerkruip, the rule would need to be:
The difference may seem subtle, but the first rule is simpler because it is purely additive: A is kept as is. The second rule is more powerful but involves somehow instructing the client about URL B. Implicitly it could be A without the query component, but not necessarily.
I don't really have a problem with the second type of rule, but I prefer the first because of its simplicity and because the client can apply it in a straightforward manner as a result of receiving a 1x status.
I may well expand this feature in Lagrange in the future, but the use case is rather specialized so it's not a high priority.
🚀 mbays · 2023-10-30 at 15:12:
@skyjake If you think of it as replacing the query component, rather than appending to the URL, doesn't the difference go away? In the protocol, a 10 response does require you to replace the query component, rather than append.
🕹️ skyjake [OP/mod...] · 2023-10-30 at 16:07:
If the auto-prompting feature's purpose is defined as causing the client to emulate the situation where a status 10 response is received after requesting a particular URL, yes, replacing the query component makes sense.
I haven't been thinking of the feature like that, though. In my mind, it's a way for the user to ensure that a chosen URL is never requested without a query string present.
I am a bit uncomfortable with the former interpretation because it makes more assumptions about how the server will behave, and doing so purely on clientside is questionable. Not saying it's bad per se; both of these interpretations rely on certain assumptions about the server/application.
🚀 mbays · 2023-10-30 at 18:34:
I guess I'm missing something. I just sourcedived to see what's going on, and it seems to me that because of the isEmpty_Range check in postOpenLinkCommand_DocumentWidget_ in ui/documentwidget.c, enabling "assume prompt" on urls with non-empty query does nothing at all. I think I'm suggesting simply deleting that check. The feature then works with gemkerkerkruip (and various other things on my capsule which work similarly). What could it break?
🚀 mbays · 2023-11-01 at 12:28:
I just realised a subtlety I've been missing in the above -- I'd been assuming that empty query is equivalent to no query, but actually that doesn't seem to be prescribed in the gemini spec (unless I'm missing it?), and RFC 3986 indicates that it only holds if it's explicitly mandated in the scheme spec. Spellbinding actually makes use of this, responding with 10 on no query ([...]/cgi) but not on empty query ([...]/cgi?). It's tricky to use this though -- at least with molly brown, the variables passed to cgi scripts can't differentiate between these two.
🕹️ skyjake [OP/mod...] · 2023-11-02 at 13:40:
I think I'm suggesting simply deleting that check.
It's not quite that simple. If this feature was allowed with URLs that already have a query string, the expected behavior would be that the query string in the URL is pre-filled into the query prompt, so the user can edit it before sending it out. Also, other UI changes would be necessary to enable this behavior for a given link on the page.
It would solve this particular issue with Gemkerkerkruip, I think, although perhaps not in the most elegant way. The user would still get the `!?` in the prompt and would have to overwrite it...
empty query is equivalent to no query
According to RFC 3875 (CGI 1.1), at least in the web world the QUERY_STRING must be set to "" if the query component is missing from the URL. So CGI applications are indeed unable to make a distinction between those two cases.
I also don't think this is currently addressed in the Gemini spec, and did mention some time ago to @solderpunk that it would be nice to have an official companion spec for Gemini server CGI.
As it stands, Gemini applications don't have to use CGI, so they can check directly if a query component is present or not in the request URL and behave differently as needed. (Bubble has several cases of this, for example.)
Gemkerkerkruip — A gaming pick for Saturday: the roguelike text adventure Kerkerkruip by Victor Gijsbers and contributors, ported to Gemini by @mbays. I think there's something fascinating about combining text adventures with roguelikes.
💬 skyjake [mod...] · 12 comments · 2 likes · 2023-10-28 · 6 months ago