From 8ea9f1433b070f748f23e187a4a688162640c574 Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Sun, 17 Nov 2019 10:22:55 +0100 Subject: Allow custom path for startpage file --- gopherproxy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gopherproxy.go') diff --git a/gopherproxy.go b/gopherproxy.go index 2a6358c..9a081dc 100644 --- a/gopherproxy.go +++ b/gopherproxy.go @@ -539,7 +539,7 @@ func FontHandler(woff2 bool, fontdata []byte) http.HandlerFunc { // specified by the request. The robots argument is a pointer to // a robotstxt.RobotsData struct for testing user agents against // a configurable robots.txt file. -func ListenAndServe(bind, robotsfile string, robotsdebug bool, vipsconcurrency int) error { +func ListenAndServe(bind, startpagefile string, robotsfile string, robotsdebug bool, vipsconcurrency int) error { var ( tpl *template.Template robotsdata *robotstxt.RobotsData @@ -600,7 +600,7 @@ func ListenAndServe(bind, robotsfile string, robotsdebug bool, vipsconcurrency i favicondata = []byte{} } - startpagedata, err := ioutil.ReadFile("startpage.txt") + startpagedata, err := ioutil.ReadFile(startpagefile) if err != nil { startpagedata = []byte{} } -- cgit v1.2.3-54-g00ecf