m
Ted Unangst tedu@tedunangst.com
Fri, 01 Apr 2022 15:23:03 -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