This commit is contained in:
Ted Unangst 2022-04-01 15:23:03 -04:00
commit 29c9afb6fc
1 changed files with 4 additions and 12 deletions

16
web.go
View File

@ -337,9 +337,7 @@ func inbox(w http.ResponseWriter, r *http.Request) {
j, err := junk.FromBytes(payload) j, err := junk.FromBytes(payload)
if err != nil { if err != nil {
ilog.Printf("bad payload: %s", err) ilog.Printf("bad payload: %s", err)
io.WriteString(os.Stdout, "bad payload\n") ilog.Writer().Write(payload)
os.Stdout.Write(payload)
io.WriteString(os.Stdout, "\n")
return return
} }
@ -365,9 +363,7 @@ func inbox(w http.ResponseWriter, r *http.Request) {
ilog.Printf("inbox message failed signature for %s from %s: %s", keyname, r.Header.Get("X-Forwarded-For"), err) ilog.Printf("inbox message failed signature for %s from %s: %s", keyname, r.Header.Get("X-Forwarded-For"), err)
if keyname != "" { if keyname != "" {
ilog.Printf("bad signature from %s", keyname) ilog.Printf("bad signature from %s", keyname)
io.WriteString(os.Stdout, "bad payload\n") ilog.Writer().Write(payload)
os.Stdout.Write(payload)
io.WriteString(os.Stdout, "\n")
} }
http.Error(w, "what did you call me?", http.StatusTeapot) http.Error(w, "what did you call me?", http.StatusTeapot)
return return
@ -456,9 +452,7 @@ func serverinbox(w http.ResponseWriter, r *http.Request) {
j, err := junk.FromBytes(payload) j, err := junk.FromBytes(payload)
if err != nil { if err != nil {
ilog.Printf("bad payload: %s", err) ilog.Printf("bad payload: %s", err)
io.WriteString(os.Stdout, "bad payload\n") ilog.Writer().Write(payload)
os.Stdout.Write(payload)
io.WriteString(os.Stdout, "\n")
return return
} }
if crappola(j) { if crappola(j) {
@ -473,9 +467,7 @@ func serverinbox(w http.ResponseWriter, r *http.Request) {
ilog.Printf("inbox message failed signature for %s from %s: %s", keyname, r.Header.Get("X-Forwarded-For"), err) ilog.Printf("inbox message failed signature for %s from %s: %s", keyname, r.Header.Get("X-Forwarded-For"), err)
if keyname != "" { if keyname != "" {
ilog.Printf("bad signature from %s", keyname) ilog.Printf("bad signature from %s", keyname)
io.WriteString(os.Stdout, "bad payload\n") ilog.Writer().Write(payload)
os.Stdout.Write(payload)
io.WriteString(os.Stdout, "\n")
} }
http.Error(w, "what did you call me?", http.StatusTeapot) http.Error(w, "what did you call me?", http.StatusTeapot)
return return