Skip to content

Commit 356fa57

Browse files
author
Jessica Lord
committed
fix(url parser): support single text record with multiple strings
1 parent 2ac63c0 commit 356fa57

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/url_parser.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,17 @@ module.exports = function(url, options, callback) {
4242
else return `${address.name}:${address.port}`;
4343
});
4444

45-
let connectionString = connectionStrings.join(',');
46-
if (records) connectionString += '/?' + records.join('&');
45+
let connectionString = connectionStrings.join(',') + '/?';
46+
47+
if (records) {
48+
let concatRecords = records.map(function(record) {
49+
// A single record with multiple strings gets concatenated
50+
if (record.length > 1) return record.join('');
51+
else return record;
52+
});
53+
54+
connectionString += concatRecords.join('&');
55+
}
4756

4857
parseHandler(connectionString, options, callback);
4958
});

0 commit comments

Comments
 (0)