Accept URLs with no trailing slash in Probe::uri

This commit is contained in:
Hypolite Petovan 2018-11-10 08:22:47 -05:00
parent aaae7b56df
commit 10a8be7943

View file

@ -575,7 +575,7 @@ class Probe
{
$parts = parse_url($uri);
if (!empty($parts["scheme"]) && !empty($parts["host"]) && !empty($parts["path"])) {
if (!empty($parts["scheme"]) && !empty($parts["host"])) {
$host = $parts["host"];
if (!empty($parts["port"])) {
$host .= ':'.$parts["port"];
@ -590,7 +590,7 @@ class Probe
return [];
}
$path_parts = explode("/", trim($parts["path"], "/"));
$path_parts = explode("/", trim(defaults($parts, 'path', ''), "/"));
while (!$lrdd && (sizeof($path_parts) > 1)) {
$host .= "/".array_shift($path_parts);