Skip to content

Commit 69b6cc6

Browse files
committed
fix: Fix server URL parsing when it doesn't include scheme
Closes #790
1 parent 525217b commit 69b6cc6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Changes

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ core:
77
parenthesis
88
* fix #789: Avoid warning on commandline about possible confusion when reading quoted
99
configuration value including a dash from configuration file
10+
* fix #790: Fix server URL parsing when it doesn't include scheme
1011

1112
inventory:
1213
* Fix rare windows perl error during drives, ipv6 network or videos inventory

lib/GLPI/Agent/Target/Server.pm

+3-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ sub _getCanonicalURL {
5050
$url->scheme('http');
5151
# Eventually split on a slash to get host and path
5252
if ($string =~ m{^([^/]+)[/](.*)$}) {
53-
$url->host($1);
54-
$url->path($2 // '');
53+
my ($host, $path) = ($1, $2);
54+
$url->host($host);
55+
$url->path($path // '');
5556
} else {
5657
$url->host($string);
5758
$url->path('');

0 commit comments

Comments
 (0)