Merge branch 'master' of github.com:elastic/elasticsearch-js into fix/leakingTimesInTransport
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
var _ = require('./utils');
|
||||
var extractHostPartsRE = /\[\/*([^:]+):(\d+)\]/;
|
||||
|
||||
var extractHostPartsRE1x = /\[\/*([^:]+):(\d+)\]/;
|
||||
var extractHostPartsRE = /^([\.:0-9a-f]*):([0-9]+)?$/;
|
||||
|
||||
function makeNodeParser(hostProp) {
|
||||
return function (nodes) {
|
||||
@ -10,8 +12,12 @@ function makeNodeParser(hostProp) {
|
||||
|
||||
var hostnameMatches = extractHostPartsRE.exec(node[hostProp]);
|
||||
if (!hostnameMatches) {
|
||||
throw new Error('node\'s ' + hostProp + ' property (' + JSON.stringify(node[hostProp]) +
|
||||
') does not match the expected pattern ' + extractHostPartsRE + '.');
|
||||
hostnameMatches = extractHostPartsRE1x.exec(node[hostProp]);
|
||||
}
|
||||
|
||||
if (!hostnameMatches) {
|
||||
throw new Error('expected node\'s ' + hostProp + ' property (' + JSON.stringify(node[hostProp]) +
|
||||
') to match either ' + extractHostPartsRE + ' or ' + extractHostPartsRE1x + '.');
|
||||
}
|
||||
|
||||
hosts.push({
|
||||
|
||||
Reference in New Issue
Block a user