|
@ -26,6 +26,8 @@ |
|
|
|
|
|
|
|
|
µMatrix.Matrix = (function() { |
|
|
µMatrix.Matrix = (function() { |
|
|
|
|
|
|
|
|
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
var µm = µMatrix; |
|
|
var µm = µMatrix; |
|
@ -167,7 +169,7 @@ var toBroaderHostname = function(hostname) { |
|
|
return ''; |
|
|
return ''; |
|
|
} |
|
|
} |
|
|
if ( isIPAddress(hostname) ) { |
|
|
if ( isIPAddress(hostname) ) { |
|
|
return '*'; |
|
|
|
|
|
|
|
|
return toBroaderIPAddress(hostname); |
|
|
} |
|
|
} |
|
|
var pos = hostname.indexOf('.'); |
|
|
var pos = hostname.indexOf('.'); |
|
|
if ( pos === -1 ) { |
|
|
if ( pos === -1 ) { |
|
@ -176,6 +178,15 @@ var toBroaderHostname = function(hostname) { |
|
|
return hostname.slice(pos + 1); |
|
|
return hostname.slice(pos + 1); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var toBroaderIPAddress = function(ipaddress) { |
|
|
|
|
|
// Can't broaden IPv6 (for now)
|
|
|
|
|
|
if ( ipaddress.charAt(0) === '[' ) { |
|
|
|
|
|
return '*'; |
|
|
|
|
|
} |
|
|
|
|
|
var pos = ipaddress.lastIndexOf('.'); |
|
|
|
|
|
return pos !== -1 ? ipaddress.slice(0, pos) : '*'; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
Matrix.toBroaderHostname = toBroaderHostname; |
|
|
Matrix.toBroaderHostname = toBroaderHostname; |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|