From 356fa57dfadbb856a0d18ce23e7968844e03fc6c Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Thu, 16 Nov 2017 14:51:38 -0500 Subject: [PATCH] fix(url parser): support single text record with multiple strings --- lib/url_parser.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/url_parser.js b/lib/url_parser.js index 3e8c934e9a..641e6585f3 100644 --- a/lib/url_parser.js +++ b/lib/url_parser.js @@ -42,8 +42,17 @@ module.exports = function(url, options, callback) { else return `${address.name}:${address.port}`; }); - let connectionString = connectionStrings.join(','); - if (records) connectionString += '/?' + records.join('&'); + let connectionString = connectionStrings.join(',') + '/?'; + + if (records) { + let concatRecords = records.map(function(record) { + // A single record with multiple strings gets concatenated + if (record.length > 1) return record.join(''); + else return record; + }); + + connectionString += concatRecords.join('&'); + } parseHandler(connectionString, options, callback); });