retry key lookups don't usually seem to work

This commit is contained in:
Ted Unangst 2019-10-08 02:31:27 -04:00
parent c6d1a0928f
commit c0f2a64983
1 changed files with 6 additions and 8 deletions

14
web.go
View File

@ -286,16 +286,14 @@ func inbox(w http.ResponseWriter, r *http.Request) {
}
keyname, err := httpsig.VerifyRequest(r, payload, zaggy)
if err != nil {
log.Printf("inbox message failed signature: %s", err)
log.Printf("inbox message failed signature for %s from %s", keyname, r.Header.Get("X-Forwarded-For"))
if keyname != "" {
keyname, err = makeitworksomehowwithoutregardforkeycontinuity(keyname, r, payload)
if err != nil {
log.Printf("still failed: %s", err)
}
}
if err != nil {
return
log.Printf("bad signature from %s", keyname)
io.WriteString(os.Stdout, "bad payload\n")
os.Stdout.Write(payload)
io.WriteString(os.Stdout, "\n")
}
return
}
what, _ := j.GetString("type")
if what == "Like" {