2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 10:46:53 +00:00

34_ESPEasy.pm: fixed typo in public ip regexp

git-svn-id: https://svn.fhem.de/fhem/trunk@14473 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dev0 2017-06-06 10:46:07 +00:00
parent 22a0816c57
commit a939b00ac2

View File

@ -36,7 +36,7 @@ use Color;
# ------------------------------------------------------------------------------
# global/default values
# ------------------------------------------------------------------------------
my $module_version = 1.14; # Version of this module
my $module_version = 1.15; # Version of this module
my $minEEBuild = 128; # informational
my $minJsonVersion = 1.02; # checked in received data
@ -54,7 +54,7 @@ my $d_displayTextWidth = 0; # display width, 0 => disable formating
# IP ranges that are allowed to connect to ESPEasy without attr allowedIPs set.
my $d_allowedIPs = "192.168.0.0/16,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,"
. "fe80::/10,::1";
. "fe80::/10,fc00::/7,::1";
# ------------------------------------------------------------------------------
# "setCmds" => "min. number of parameters"
@ -274,6 +274,7 @@ sub ESPEasy_Define($$) # only called when defined, not on reload.
my $ipv = ($port =~ m/^IPV6:/i ? 6 : 4) if defined $port;
$hash->{IPV} = $ipv;
# Check OS IPv6 support
if ($ipv == 6) {
use constant HAS_AF_INET6 => defined eval { Socket::AF_INET6() };
Log3 $name, 2, "$type $name: WARNING: Your system seems to have no IPv6 support."
@ -607,8 +608,8 @@ sub ESPEasy_Read($) {
# mask password in authorization header with ****
my $logHeader = { %$header };
# public IPs
my $re = "^(127|193.168|172.(1[6-9]|2[0-9]|3[01])|10|169.254)\\.|"
# public IPs
my $re = "^(127|192.168|172.(1[6-9]|2[0-9]|3[01])|10|169.254)\\.|"
. "^(fe[89ab]|::1)";
if (!defined $logHeader->{Authorization} && $peer !~ m/$re/) {
Log3 $bname, 2, "$btype $name: No basic auth set while using a public IP "
@ -1704,8 +1705,6 @@ sub ESPEasy_TcpServer_Accept($$)
}
# ------------------------------------------------------------------------------
sub ESPEasy_header2Hash($) {
my ($string) = @_;