Skip to content

Commit ce078db

Browse files
committed
refactor: use peer.Decode for now to validate IPNS component
1 parent 23bc2f6 commit ce078db

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"
@@ -376,7 +375,8 @@ func (i *handler) isTrustlessRequest(contentPath ipath.Path, responseFormat stri
376375
}
377376

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

ipns/name.go

-37
This file was deleted.

ipns/name_test.go

-28
This file was deleted.

0 commit comments

Comments
 (0)