all repos — honk @ 5a0da852e400bba1e3520961b4717860c7f0c9db

my fork of honk

make sure all the logging goes in the log
Ted Unangst tedu@tedunangst.com
Tue, 29 Mar 2022 19:33:08 -0400
commit

5a0da852e400bba1e3520961b4717860c7f0c9db

parent

99b067ca1b388fe3c1f4172d8bf9e345f1703d60

1 files changed, 4 insertions(+), 12 deletions(-)

jump to
M web.goweb.go

@@ -337,9 +337,7 @@ payload := buf.Bytes()

j, err := junk.FromBytes(payload) if err != nil { ilog.Printf("bad payload: %s", err) - io.WriteString(os.Stdout, "bad payload\n") - os.Stdout.Write(payload) - io.WriteString(os.Stdout, "\n") + ilog.Writer().Write(payload) return }

@@ -365,9 +363,7 @@ if err != nil {

ilog.Printf("inbox message failed signature for %s from %s: %s", keyname, r.Header.Get("X-Forwarded-For"), err) if keyname != "" { ilog.Printf("bad signature from %s", keyname) - io.WriteString(os.Stdout, "bad payload\n") - os.Stdout.Write(payload) - io.WriteString(os.Stdout, "\n") + ilog.Writer().Write(payload) } http.Error(w, "what did you call me?", http.StatusTeapot) return

@@ -456,9 +452,7 @@ payload := buf.Bytes()

j, err := junk.FromBytes(payload) if err != nil { ilog.Printf("bad payload: %s", err) - io.WriteString(os.Stdout, "bad payload\n") - os.Stdout.Write(payload) - io.WriteString(os.Stdout, "\n") + ilog.Writer().Write(payload) return } if crappola(j) {

@@ -473,9 +467,7 @@ if err != nil {

ilog.Printf("inbox message failed signature for %s from %s: %s", keyname, r.Header.Get("X-Forwarded-For"), err) if keyname != "" { ilog.Printf("bad signature from %s", keyname) - io.WriteString(os.Stdout, "bad payload\n") - os.Stdout.Write(payload) - io.WriteString(os.Stdout, "\n") + ilog.Writer().Write(payload) } http.Error(w, "what did you call me?", http.StatusTeapot) return