Specification clearly states:
URL may be absolute or relative. If relative, it should be resolved
against the URL used in the original request.
So "gemini://foo.bar/baz" with "doo" relative URL must give
"gemini://foo.bar/baz/doo" URL. But initial Gemini's Python demo
(https://tildegit.org/solderpunk/gemini-demo-1.git) performs urljoin
call, that will give "gemini://foo.bar/doo". Seems that many gemsites
expect that behaviour from the client.
if strings.HasPrefix(line, "=>") {
line = strings.TrimLeft(line[2:], " ")
cols = strings.Fields(line)
if strings.HasPrefix(line, "=>") {
line = strings.TrimLeft(line[2:], " ")
cols = strings.Fields(line)
- u := geminifyURL(host, cols[0], paths...)
+ u1 := geminifyURL(host, cols[0], paths...)
+ u2 := geminifyURL(host, cols[0])
switch len(cols) {
case 1:
fmt.Fprintf(
switch len(cols) {
case 1:
fmt.Fprintf(
- &buf, "<a href=\"%s\">%s</a><br/>\n",
- u, html.EscapeString(cols[0]),
+ &buf, "<a href=\"%s\">%s</a> <a href=\"%s\">[2]</a><br/>\n",
+ u1, html.EscapeString(cols[0]), u2,
- &buf, "<a href=\"%s\">%s</a> (<tt>%s</tt>)<br/>\n",
- u, html.EscapeString(strings.Join(cols[1:], " ")), cols[0],
+ &buf, "<a href=\"%s\">%s</a> <a href=\"%s\">[2]</a>(<tt>%s</tt>)<br/>\n",
+ u1, html.EscapeString(strings.Join(cols[1:], " ")), u2, cols[0],