Closed DavidGriffith closed 4 years ago
The offending code seems to be line 74 in pygopherd/handlers/gophermap.py:
if selector[0] != '/': # Relative link
Since the first character isn't /, the gophermap handler assumes URL:http://www.foobar.com
is a relative path. This fix should do it:
if selector[0] != '/' and selector[0:4] != "URL:": # Relative link
If anyone still uses UMN-style links, the equivalent fix is to line 212 in pygopherd/handlers/UMN.py:
elif len(pathname) and pathname[0] != '/' and pathname[0:4] != "URL:":
I've opened a pull request.
@jgoerzen Thanks for the merge! This issue can now be closed.
This line is also responsible for telnet links being broken.
The following line in my gophermap file
8BBS[tab]none[tab]bbs.thesprawl.city[tab]23
will become this link:
telnet///none@bbs.thesprawl.city:23/
Note the extra /
To get the correct telnet link my workarround for line 74 looks as follows:
if selector[0] != '/' and arg[0][0] != '8':
Suppose we have
/var/gopher/gophermap
. Then/var/gopher/foo/gophermap
. An html link in the firstgophermap
file will be handled correctly. In the secondgophermap
, this is the result: