Skip to content

Commit

Permalink
Use "peer" schema for unknown providers at /routing/v1/providers
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 committed Aug 26, 2023
1 parent d27c5a6 commit 2d578a8
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 @@ -23,6 +23,7 @@ import (
)

const (
peerSchema = "peer"
unknownProtocol = "unknown"
unknownSchema = unknownProtocol
)
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 2d578a8

Please sign in to comment.