Skip to content

Commit

Permalink
Use "peer" schema for unknown providers at /routing/v1/providers (#148)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gammazero authored Jan 18, 2024
1 parent 7e3a44f commit 4c5fa14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions delegated_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
)

const (
peerSchema = "peer"
unknownProtocol = "unknown"
unknownSchema = unknownProtocol
)
Expand Down Expand Up @@ -132,10 +133,9 @@ func (dt *delegatedTranslator) find(w http.ResponseWriter, r *http.Request, encr
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() {
Expand Down

0 comments on commit 4c5fa14

Please sign in to comment.