nodes.js (nsq-1.2.0) | : | nodes.js (nsq-1.2.1) | ||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
constructor: function Nodes() { | constructor: function Nodes() { | |||
Backbone.Collection.prototype.constructor.apply(this, arguments); | Backbone.Collection.prototype.constructor.apply(this, arguments); | |||
}, | }, | |||
url: function() { | url: function() { | |||
return AppState.apiPath('/nodes'); | return AppState.apiPath('/nodes'); | |||
}, | }, | |||
parse: function(resp) { | parse: function(resp) { | |||
resp['nodes'].forEach(function(n) { | ||||
var jaddr = n['broadcast_address']; | ||||
if (jaddr.includes(':')) { | ||||
// ipv6 raw address contains ':' | ||||
// it must be wrapped in '[ ]' when joined with port | ||||
jaddr = '[' + jaddr + ']'; | ||||
} | ||||
n['broadcast_address_http'] = jaddr + ':' + n['http_port']; | ||||
}); | ||||
return resp['nodes']; | return resp['nodes']; | |||
} | } | |||
}); | }); | |||
module.exports = Nodes; | module.exports = Nodes; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 9 lines changed or added |