Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 71876e9

Browse files
committed
refactor: move tests to interface-ipfs-core
1 parent abc9379 commit 71876e9

File tree

4 files changed

+5
-67
lines changed

4 files changed

+5
-67
lines changed

src/cli/commands/dns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
handler ({ getIpfs, domain, resolve, recursive, format }) {
2222
resolve((async () => {
2323
const ipfs = await getIpfs()
24-
const path = await ipfs.dns(domain, opts)
24+
const path = await ipfs.dns(domain, { recursive, format })
2525
print(path)
2626
})())
2727
}

src/core/runtime/dns-nodejs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ const MAX_RECURSIVE_DEPTH = 32
99

1010
module.exports = (domain, opts, callback) => {
1111
// recursive is true by default, it's set to false only if explicitly passed as argument in opts
12-
const recursive = opts.recursive == null ? true : Boolean(opts.recursive)
12+
const recursive = opts.recursive.toString() !== 'false'
1313

1414
let depth
1515
if (recursive) {
16-
depth = maxRecursiveDepth
16+
depth = MAX_RECURSIVE_DEPTH
1717
}
1818

1919
return recursiveResolveDnslink(domain, depth, callback)

src/http/api/resources/dns.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
const Boom = require('boom')
44

55
module.exports = async (request, h) => {
6-
const { arg: domain, ...opts } = request.query
6+
const { arg: domain, recursive, format } = request.query
77

88
if (!domain) {
99
throw Boom.badRequest("Argument 'domain' is required")
1010
}
1111

12-
const path = await request.server.app.ipfs.dns(domain, opts)
12+
const path = await request.server.app.ipfs.dns(domain, { recursive, format })
1313
return h.response({
1414
Path: path
1515
})

test/core/dns.spec.js

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

0 commit comments

Comments
 (0)