make sure all the logging goes in the log
This commit is contained in:
parent
72e2424606
commit
cd64411079
16
web.go
16
web.go
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue