Skip to content

Commit c68c5f4

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

File tree

3 files changed

+2
-67
lines changed

3 files changed

+2
-67
lines changed

gateway/handler.go

+2-2
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

-37
This file was deleted.

ipns/name_test.go

-28
This file was deleted.

0 commit comments

Comments
 (0)