aboutsummaryrefslogtreecommitdiffstats
path: root/gopherproxy.go
diff options
context:
space:
mode:
Diffstat (limited to 'gopherproxy.go')
-rw-r--r--gopherproxy.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/gopherproxy.go b/gopherproxy.go
index 8b33c05..d98ef7c 100644
--- a/gopherproxy.go
+++ b/gopherproxy.go
@@ -132,7 +132,7 @@ func GopherHandler(tpl *template.Template, robotsdata *robotstxt.RobotsData, ass
132 RawText string 132 RawText string
133 Lines []Item 133 Lines []Item
134 Error bool 134 Error bool
135 }{uri, fmt.Sprintf("%s/%s", hostport, uri), assetList, fmt.Sprintf("Error: %s", err), nil, true}) 135 }{"", hostport, assetList, fmt.Sprintf("Error: %s", err), nil, true})
136 return 136 return
137 } 137 }
138 138
@@ -346,6 +346,17 @@ func ListenAndServe(bind, robotsfile string, robotsdebug bool, vipsconcurrency i
346 var inputStr = fmt.Sprintf("%v", input) 346 var inputStr = fmt.Sprintf("%v", input)
347 return re.ReplaceAllString(inputStr, output) 347 return re.ReplaceAllString(inputStr, output)
348 }, 348 },
349 "trimLeftChar": func(s string) string {
350 for i := range s {
351 if i > 0 {
352 return s[i:]
353 }
354 }
355 return s[:0]
356 },
357 "hasPrefix": func(s string, prefix string) bool {
358 return strings.HasPrefix(s, prefix)
359 },
349 } 360 }
350 361
351 tpl, err = template.New("gophermenu").Funcs(funcMap).Parse(tpltext) 362 tpl, err = template.New("gophermenu").Funcs(funcMap).Parse(tpltext)