make sure all the logging goes in the log
Ted Unangst tedu@tedunangst.com
Tue, 29 Mar 2022 19:33:08 -0400
1 files changed,
4 insertions(+),
12 deletions(-)
jump to
M
web.go
→
web.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