Skip to content

Commit

Permalink
fix: Fix server URL parsing when it doesn't include scheme
Browse files Browse the repository at this point in the history
Closes #790
  • Loading branch information
g-bougard committed Oct 11, 2024
1 parent 525217b commit 69b6cc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ core:
parenthesis
* fix #789: Avoid warning on commandline about possible confusion when reading quoted
configuration value including a dash from configuration file
* fix #790: Fix server URL parsing when it doesn't include scheme

inventory:
* Fix rare windows perl error during drives, ipv6 network or videos inventory
Expand Down
5 changes: 3 additions & 2 deletions lib/GLPI/Agent/Target/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ sub _getCanonicalURL {
$url->scheme('http');
# Eventually split on a slash to get host and path
if ($string =~ m{^([^/]+)[/](.*)$}) {
$url->host($1);
$url->path($2 // '');
my ($host, $path) = ($1, $2);
$url->host($host);
$url->path($path // '');
} else {
$url->host($string);
$url->path('');
Expand Down

0 comments on commit 69b6cc6

Please sign in to comment.