diff options
| author | Feuerfuchs <git@feuerfuchs.dev> | 2019-11-17 10:41:24 +0100 |
|---|---|---|
| committer | Feuerfuchs <git@feuerfuchs.dev> | 2019-11-17 10:41:24 +0100 |
| commit | 1802def60fbb164a05989d09b76ae82024af778f (patch) | |
| tree | 2be0032f17becd21a03eb1c3bdf9e3f4455db595 | |
| parent | Allow custom path for startpage file (diff) | |
| download | gopherproxy-1802def60fbb164a05989d09b76ae82024af778f.tar.gz gopherproxy-1802def60fbb164a05989d09b76ae82024af778f.tar.bz2 gopherproxy-1802def60fbb164a05989d09b76ae82024af778f.zip | |
Include a default startpage (WIP)
| -rw-r--r-- | gopherproxy.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gopherproxy.go b/gopherproxy.go index 9a081dc..a91e057 100644 --- a/gopherproxy.go +++ b/gopherproxy.go | |||
| @@ -602,7 +602,10 @@ func ListenAndServe(bind, startpagefile string, robotsfile string, robotsdebug b | |||
| 602 | 602 | ||
| 603 | startpagedata, err := ioutil.ReadFile(startpagefile) | 603 | startpagedata, err := ioutil.ReadFile(startpagefile) |
| 604 | if err != nil { | 604 | if err != nil { |
| 605 | startpagedata = []byte{} | 605 | startpagedata, err = box.Find("startpage.txt") |
| 606 | if err != nil { | ||
| 607 | startpagedata = []byte{} | ||
| 608 | } | ||
| 606 | } | 609 | } |
| 607 | startpagetext := string(startpagedata) | 610 | startpagetext := string(startpagedata) |
| 608 | 611 | ||
