From 1a88e471815483d995b7d8e79f190d5131497316 Mon Sep 17 00:00:00 2001 From: Xuu Date: Thu, 22 Oct 2020 21:28:43 -0600 Subject: [PATCH] fix ranging for proofs --- src/routes/identity.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routes/identity.go b/src/routes/identity.go index ce134fb..75224ed 100644 --- a/src/routes/identity.go +++ b/src/routes/identity.go @@ -113,7 +113,8 @@ func (s *identity) get(w http.ResponseWriter, r *http.Request) { for i := range entity.Proofs { q.Run(ProofKey(entity.Proofs[i]), func(q promise.Q) { - proof := NewProof(entity.Proofs[i]) + key := q.Key().(ProofKey) + proof := NewProof(string(key)) q.Resolve(proof) }) @@ -153,11 +154,14 @@ func (s *identity) get(w http.ResponseWriter, r *http.Request) { gotProofs = true if len(page.Entity.Proofs) > 0 { proofs := make(Proofs, len(page.Entity.Proofs)) - for _, p := range page.Entity.Proofs { + for i := range page.Entity.Proofs { + p := page.Entity.Proofs[i] + proofs[p] = NewProof(p) if s, ok := s.cache.Get(ProofKey(p)); ok { proofs[p] = s.Value().(*Proof) } else { + log.Info("Missing proof", p) gotProofs = false } }