Skip to content

Commit

Permalink
fix(url parser): support single text record with multiple strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Lord committed Nov 20, 2017
1 parent 2ac63c0 commit 356fa57
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/url_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit 356fa57

Please sign in to comment.