aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkelarious <darkelarious@333networks.com>2022-08-19 17:00:31 +0200
committerDarkelarious <darkelarious@333networks.com>2022-08-19 17:00:31 +0200
commitc5f43733533fe9b5708bd065a12c5fac86ccebed (patch)
tree4fbc00da35e353eca9193500993b44e8f62c281c
parente8be3c0138d4180a905996f412a4f0ed5ace56d9 (diff)
downloadWebInterface-Perl-c5f43733533fe9b5708bd065a12c5fac86ccebed.tar.gz
WebInterface-Perl-c5f43733533fe9b5708bd065a12c5fac86ccebed.zip
untighten parameter checks
-rwxr-xr-xChangelog4
-rwxr-xr-xlib/MasterWebInterface/Handler/Json/JsonServerInfo.pm6
2 files changed, 7 insertions, 3 deletions
diff --git a/Changelog b/Changelog
index 936eafe..5cc3802 100755
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,8 @@
Changelog:
+
+19-08-2022: untighten parameter checks
+ * serverinfo search can also happen without ip/port check
+
07-08-2022: fixes in Json API
* update manual to reflect use of JSON instead of JSON::XS
diff --git a/lib/MasterWebInterface/Handler/Json/JsonServerInfo.pm b/lib/MasterWebInterface/Handler/Json/JsonServerInfo.pm
index 2ff6194..a3b2d08 100755
--- a/lib/MasterWebInterface/Handler/Json/JsonServerInfo.pm
+++ b/lib/MasterWebInterface/Handler/Json/JsonServerInfo.pm
@@ -21,7 +21,7 @@ sub json_serverinfo
ip => $ip,
hostport => $port,
limit => 1,
- )->[0] if ($ip && $port);
+ )->[0];
# allow all outside sources to access the json api
$self->resHeader("Access-Control-Allow-Origin", "*");
@@ -33,8 +33,8 @@ sub json_serverinfo
$self->resJSON({
error => 1,
in => "not_in_db",
- ip => $ip,
- port => $port,
+ ip => $ip // "0.0.0.0",
+ port => $port // 0,
});
return;
}