flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit c8e0ba1236a60ef06c4a4df4e5ddf269ee83d888
parent 16654ebad750d1209417c88f7208ffe8300a3a79
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 24 Oct 2021 18:08:25 -0700

Add empty string welcome

Diffstat:
Mfinger.go | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/finger.go b/finger.go @@ -16,6 +16,9 @@ func runFingerServer() { log.Println("Starting finger server") s := &finger.Server{ Handler: finger.HandlerFunc(func(ctx context.Context, w io.Writer, q *finger.Query) { + if q.Username == "" { + w.Write([]byte("You've found the flounder finger server. Welcome.\n")) + } userName := filepath.Clean(q.Username) fullPath := path.Join(c.FilesDirectory, userName, "finger") f, err := os.Open(fullPath)