pixl-server-web
Advanced tools
Comparing version 1.3.5 to 1.3.6
{ | ||
"name": "pixl-server-web", | ||
"version": "1.3.5", | ||
"version": "1.3.6", | ||
"description": "A web server component for the pixl-server framework.", | ||
@@ -5,0 +5,0 @@ "author": "Joseph Huckaby <jhuckaby@gmail.com>", |
@@ -309,9 +309,14 @@ // Simple HTTP / HTTPS Web Server | ||
getPublicIP(ips) { | ||
// filter out garbage that doesn't resemble ips | ||
var real_ips = ips.filter( function(ip) { | ||
return ip.match( /^([\d\.]+|[a-f0-9:]+)$/ ); | ||
} ); | ||
// determine first public IP from list of IPs | ||
for (var idx = 0, len = ips.length; idx < len; idx++) { | ||
if (!this.aclPrivateRanges.check(ips[idx])) return ips[idx]; | ||
for (var idx = 0, len = real_ips.length; idx < len; idx++) { | ||
if (!this.aclPrivateRanges.check(real_ips[idx])) return real_ips[idx]; | ||
} | ||
// default to first ip | ||
return ips[0]; | ||
return real_ips[0]; | ||
} | ||
@@ -318,0 +323,0 @@ |
Sorry, the diff of this file is too big to display
207383
3447