Stringify default port numbers

The IO::Socket classes expect strings for the port number because you
can pass service names from `/etc/services`. Numbers work too, but
using strings everywhere makes it easier to write unit tests.
This commit is contained in:
Richard Hansen 2020-07-05 16:12:12 -04:00
parent d79519f59c
commit a15cec7cd9

View file

@ -2009,10 +2009,10 @@ sub geturl {
## always omit SSL for connections to local router
if ($force_ssl || ($globals{'ssl'} and (caller(1))[3] ne 'main::get_ip')) {
$use_ssl = 1;
$default_port = 443;
$default_port = '443';
} else {
$use_ssl = 0;
$default_port = 80;
$default_port = '80';
}
debug("proxy = %s", $proxy);
debug("protocol = %s", $use_ssl ? "https" : "http");