From 2d578a8d7a7d365dc2e88c70722ff14c2e0250d6 Mon Sep 17 00:00:00 2001 From: gammazero Date: Sat, 26 Aug 2023 00:17:10 -0700 Subject: [PATCH] Use "peer" schema for unknown providers at /routing/v1/providers The /routing/v1/providers/ endpoint now reports unknown schema as "peer", and omits the Protocol. Testing was manual testing using example in issue. Fixes #147 --- delegated_translator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/delegated_translator.go b/delegated_translator.go index 9a533a7..d6e6869 100644 --- a/delegated_translator.go +++ b/delegated_translator.go @@ -23,6 +23,7 @@ import ( ) const ( + peerSchema = "peer" unknownProtocol = "unknown" unknownSchema = unknownProtocol ) @@ -157,10 +158,9 @@ func (dt *delegatedTranslator) find(w http.ResponseWriter, r *http.Request) { err := md.UnmarshalBinary(p.Metadata) if err != nil { appendIfUnique(&drProvider{ - Protocol: unknownProtocol, - Schema: unknownSchema, - ID: p.Provider.ID, - Addrs: p.Provider.Addrs, + Schema: peerSchema, + ID: p.Provider.ID, + Addrs: p.Provider.Addrs, }) } else { for _, proto := range md.Protocols() {