Comparing version 0.2.0 to 0.2.1
@@ -85,2 +85,3 @@ module.exports = function () { | ||
var object; | ||
if (!err && value) { | ||
@@ -103,4 +104,5 @@ try { | ||
if (object[question.type]) { | ||
object[question.type].forEach(function(data) { | ||
answer.data = data; | ||
var vector = typeof(object[question.type]) === 'Array' ? object[question.type] : [object[question.type]]; | ||
vector.forEach(function(data) { | ||
answer.data = ''+data; | ||
res.answer.push(answer); | ||
@@ -107,0 +109,0 @@ $this.logger.log('info', '%s:%s/%s - local - %s question:"%s" - %j', req.connection.remoteAddress, req.connection.remotePort, req.connection.type, hostname, question, answer, $this.meta); |
@@ -56,6 +56,6 @@ module.exports = function () { | ||
if (req.body.ipv4) { | ||
record.A = req.body.ipv4; | ||
record.A = typeof(req.body.ipv4) === 'Array' ? req.body.ipv4 : [req.body.ipv4]; | ||
} | ||
if (req.body.ipv6) { | ||
record.AAAA = req.body.ipv6; | ||
record.AAAA = typeof(req.body.ipv6) === 'Array' ? req.body.ipv6 : [req.body.ipv6]; | ||
} | ||
@@ -80,3 +80,3 @@ } | ||
} | ||
var hostname = hostnames.shift(); | ||
var hostname = ''+hostnames.shift(); // Make sure it is a string | ||
var arpa = hostname.split('.').reverse().join('.') + '.in-addr.arpa'; | ||
@@ -83,0 +83,0 @@ store.set(prefix + arpa, JSON.stringify(record), function (err, result) { |
@@ -5,3 +5,3 @@ { | ||
"description": "A DNS Server with a REST API", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "dns", |
239404
462