Skip to content

Commit

Permalink
bitswap/httpnet: remove dup code block (leftover)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanjuan committed Feb 13, 2025
1 parent 5271e67 commit 4645270
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions bitswap/network/httpnet/httpnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,26 +390,6 @@ func (ht *Network) Connect(ctx context.Context, p peer.AddrInfo) error {
htaddrs.Addrs = filteredAddrs

Check warning on line 390 in bitswap/network/httpnet/httpnet.go

View check run for this annotation

Codecov / codecov/patch

bitswap/network/httpnet/httpnet.go#L389-L390

Added lines #L389 - L390 were not covered by tests
}

urls := network.ExtractURLsFromPeer(htaddrs)

// allowlist
if len(ht.allowlist) > 0 {
var filteredURLs []network.ParsedURL
var filteredAddrs []multiaddr.Multiaddr
for i, u := range urls {
host, _, err := net.SplitHostPort(u.URL.Host)
if err != nil {
return err
}
if _, ok := ht.allowlist[host]; ok {
filteredURLs = append(filteredURLs, u)
filteredAddrs = append(filteredAddrs, htaddrs.Addrs[i])
}
}
urls = filteredURLs
htaddrs.Addrs = filteredAddrs
}

// if len(filteredURLs == 0) nothing will happen below and we will return
// an error below.

Expand Down

0 comments on commit 4645270

Please sign in to comment.