Skip to content

Commit

Permalink
remove todo from gateway and replace by ipns.Name
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jun 14, 2023
1 parent 3c5b559 commit 3d60b03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateway/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

ipath "github.com/ipfs/boxo/coreiface/path"
"github.com/ipfs/boxo/gateway/assets"
"github.com/ipfs/boxo/ipns"
cid "github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p/core/peer"
Expand Down Expand Up @@ -343,8 +344,7 @@ func (i *handler) isTrustlessRequest(contentPath ipath.Path, responseFormat stri
}

// Only valid, cryptographically verifiable IPNS record names (no DNSLink on trustless gateways)
// TODO: replace with ipns.Name as part of https://github.com/ipfs/specs/issues/376
if _, err := peer.Decode(pathComponents[1]); err != nil {
if _, err := ipns.NameFromString(pathComponents[1]); err != nil {
return false
}

Expand Down

0 comments on commit 3d60b03

Please sign in to comment.