Skip to content

Commit e10c5fb

Browse files
committed
refactor: use peer.Decode for now to validate IPNS component
1 parent d5f7aa8 commit e10c5fb

3 files changed

Lines changed: 2 additions & 67 deletions

File tree

gateway/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"time"
1818

1919
ipath "github.com/ipfs/boxo/coreiface/path"
20-
"github.com/ipfs/boxo/ipns"
2120
cid "github.com/ipfs/go-cid"
2221
logging "github.com/ipfs/go-log"
2322
"github.com/libp2p/go-libp2p/core/peer"
@@ -380,7 +379,8 @@ func (i *handler) isTrustlessRequest(contentPath ipath.Path, responseFormat stri
380379
}
381380

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

ipns/name.go

Lines changed: 0 additions & 37 deletions
This file was deleted.

ipns/name_test.go

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)