Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old DND TXT schema #2193

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions namesys/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,6 @@ func (r *DNSResolver) resolveOnce(ctx context.Context, name string) (path.Path,
}

func parseEntry(txt string) (path.Path, error) {
p, err := path.ParseKeyToPath(txt) // bare IPFS multihashes
if err == nil {
return p, nil
}

return tryParseDnsLink(txt)
}

func tryParseDnsLink(txt string) (path.Path, error) {
parts := strings.SplitN(txt, "=", 2)
if len(parts) == 2 && parts[0] == "dnslink" {
return path.ParsePath(parts[1])
Expand Down
2 changes: 1 addition & 1 deletion namesys/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ func (m *mockDNS) lookupTXT(name string) (txt []string, err error) {
func TestDnsEntryParsing(t *testing.T) {

goodEntries := []string{
"QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
"dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
"dnslink=/ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
"dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/foo",
Expand All @@ -36,6 +35,7 @@ func TestDnsEntryParsing(t *testing.T) {
"dnslink=",
"dnslink=/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/foo",
"dnslink=ipns/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/bar",
"QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", // Old schema, no longer valid
}

for _, e := range goodEntries {
Expand Down