diff options
author | Feuerfuchs <git@feuerfuchs.dev> | 2019-11-17 10:22:55 +0100 |
---|---|---|
committer | Feuerfuchs <git@feuerfuchs.dev> | 2019-11-17 10:22:55 +0100 |
commit | 8ea9f1433b070f748f23e187a4a688162640c574 (patch) | |
tree | d6517705321a32dfbf24ea85830ea1b5574cde10 /gopherproxy.go | |
parent | Report template errors, add support for start page (diff) | |
download | gopherproxy-8ea9f1433b070f748f23e187a4a688162640c574.tar.gz gopherproxy-8ea9f1433b070f748f23e187a4a688162640c574.tar.bz2 gopherproxy-8ea9f1433b070f748f23e187a4a688162640c574.zip |
Allow custom path for startpage file
Diffstat (limited to 'gopherproxy.go')
-rw-r--r-- | gopherproxy.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 { | |||
539 | // specified by the request. The robots argument is a pointer to | 539 | // specified by the request. The robots argument is a pointer to |
540 | // a robotstxt.RobotsData struct for testing user agents against | 540 | // a robotstxt.RobotsData struct for testing user agents against |
541 | // a configurable robots.txt file. | 541 | // a configurable robots.txt file. |
542 | func ListenAndServe(bind, robotsfile string, robotsdebug bool, vipsconcurrency int) error { | 542 | func ListenAndServe(bind, startpagefile string, robotsfile string, robotsdebug bool, vipsconcurrency int) error { |
543 | var ( | 543 | var ( |
544 | tpl *template.Template | 544 | tpl *template.Template |
545 | robotsdata *robotstxt.RobotsData | 545 | robotsdata *robotstxt.RobotsData |
@@ -600,7 +600,7 @@ func ListenAndServe(bind, robotsfile string, robotsdebug bool, vipsconcurrency i | |||
600 | favicondata = []byte{} | 600 | favicondata = []byte{} |
601 | } | 601 | } |
602 | 602 | ||
603 | startpagedata, err := ioutil.ReadFile("startpage.txt") | 603 | startpagedata, err := ioutil.ReadFile(startpagefile) |
604 | if err != nil { | 604 | if err != nil { |
605 | startpagedata = []byte{} | 605 | startpagedata = []byte{} |
606 | } | 606 | } |