flounder

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

commit 2dff9268624c71e83dc10145e6eb29058f3f0fb2
parent 45b3905418e922b12639ff76f0d42a7d453ad02b
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat,  2 Jan 2021 10:33:19 -0800

Log destination host

Diffstat:
Mlog.go | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/log.go b/log.go @@ -54,13 +54,17 @@ func buildCommonLogLine(req *http.Request, url url.URL, ts time.Time, status int uri = url.RequestURI() } - buf := make([]byte, 0, 3*(len(host)+len(username)+len(req.Method)+len(uri)+len(req.Proto)+50)/2) + desthost := req.Host + + buf := make([]byte, 0, 3*(len(host)+len(desthost)+len(username)+len(req.Method)+len(uri)+len(req.Proto)+50)/2) buf = append(buf, host...) buf = append(buf, " - "...) buf = append(buf, username...) buf = append(buf, " ["...) buf = append(buf, ts.Format("02/Jan/2006:15:04:05 -0700")...) - buf = append(buf, `] "`...) + buf = append(buf, `] `...) + buf = append(buf, desthost...) + buf = append(buf, ` "`...) buf = append(buf, req.Method...) buf = append(buf, " "...) buf = appendQuoted(buf, uri)