aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeuerfuchs <git@feuerfuchs.dev>2019-11-12 14:45:01 +0100
committerFeuerfuchs <git@feuerfuchs.dev>2019-11-12 14:45:01 +0100
commitd39c38b5a8f8d69facecf55ba1fc58e14ede6668 (patch)
tree2b8c6e5af14745323e1240b923a8edcb7b383bc2
parentInclude comma in URL regex (diff)
downloadgopherproxy-d39c38b5a8f8d69facecf55ba1fc58e14ede6668.tar.gz
gopherproxy-d39c38b5a8f8d69facecf55ba1fc58e14ede6668.tar.bz2
gopherproxy-d39c38b5a8f8d69facecf55ba1fc58e14ede6668.zip
Handle links starting with /URL: correctly
-rw-r--r--gopherproxy.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/gopherproxy.go b/gopherproxy.go
index c91afdf..87a1ad0 100644
--- a/gopherproxy.go
+++ b/gopherproxy.go
@@ -63,6 +63,8 @@ func renderDirectory(w http.ResponseWriter, tpl *template.Template, assetList As
63 63
64 if strings.HasPrefix(x.Selector, "URL:") { 64 if strings.HasPrefix(x.Selector, "URL:") {
65 tr.Link = template.URL(x.Selector[4:]) 65 tr.Link = template.URL(x.Selector[4:])
66 } else if strings.HasPrefix(x.Selector, "/URL:") {
67 tr.Link = template.URL(x.Selector[5:])
66 } else { 68 } else {
67 var hostport string 69 var hostport string
68 if x.Port == 70 { 70 if x.Port == 70 {