Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ The following emojis are used to highlight certain changes:

### Added


### Changed

### Removed

### Fixed

- Fix a bug whereby, cached peers with private multiaddrs were returned in `/routing/v1/providers` responses, as they were not passing through `sanitizeRouter`.

### Security

## [v0.7.0]
Expand Down
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@
var dhtRouter router

if cachedAddrBook != nil {
dhtRouter = NewCachedRouter(sanitizeRouter{libp2pRouter{routing: dht}}, cachedAddrBook)
cachedRouter := NewCachedRouter(libp2pRouter{routing: dht}, cachedAddrBook)
dhtRouter = sanitizeRouter{cachedRouter}

Check warning on line 250 in server.go

View check run for this annotation

Codecov / codecov/patch

server.go#L249-L250

Added lines #L249 - L250 were not covered by tests
} else {
dhtRouter = sanitizeRouter{libp2pRouter{routing: dht}}
}
Expand Down
1 change: 1 addition & 0 deletions server_cached_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const (
)

// cachedRouter wraps a router with the cachedAddrBook to retrieve cached addresses for peers without multiaddrs in FindProviders
// it will also dispatch a FindPeer when a provider has no multiaddrs using the cacheFallbackIter
type cachedRouter struct {
router
cachedAddrBook *cachedAddrBook
Expand Down
Loading