diff --git a/app/peerfinder/http.go b/app/peerfinder/http.go index aed6f58..03c694b 100644 --- a/app/peerfinder/http.go +++ b/app/peerfinder/http.go @@ -206,6 +206,7 @@ func (s *service) getPending(w http.ResponseWriter, r *http.Request, peerID stri if err != nil && !errors.Is(err, ev.ErrNotFound) { span.RecordError(fmt.Errorf("peer not found: %w", err)) w.WriteHeader(http.StatusNotFound) + return } var req *Request @@ -223,6 +224,7 @@ func (s *service) getPending(w http.ResponseWriter, r *http.Request, peerID stri if req == nil { span.RecordError(fmt.Errorf("request not found")) w.WriteHeader(http.StatusNoContent) + return } negotiator := contentnegotiation.NewNegotiator("application/json", "text/environment", "text/plain", "text/html") @@ -451,6 +453,7 @@ func (s *service) postResult(w http.ResponseWriter, r *http.Request, reqID strin if err != nil { span.RecordError(fmt.Errorf("peer not found: %w", err)) w.WriteHeader(http.StatusNotFound) + return } if peerResults.Has(reqID) {