added support to enable relative URLs in graphs #410

This commit is contained in:
Jordi Sanfeliu 2022-03-04 09:43:13 +01:00
parent bd8582e0b8
commit 899c57a8ba
1 changed files with 6 additions and 4 deletions

View File

@ -310,11 +310,13 @@ if($config{include_dir} && opendir(DIR, $config{include_dir})) {
$config{url} = ($config{url_prefix_proxy} || "");
if(!$config{url}) {
$config{url} = ($ENV{HTTPS} || ($config{httpd_builtin}->{https_url} || "n") eq "y") ? "https://" . $ENV{HTTP_HOST} : "http://" . $ENV{HTTP_HOST};
$config{hostname} = $config{hostname} || $ENV{SERVER_NAME};
if(!($config{hostname})) { # called from the command line
$config{hostname} = "127.0.0.1";
$config{url} = "http://127.0.0.1";
if(lc($config{enable_relative_urls} || "") ne "y") {
$config{url} = ($ENV{HTTPS} || ($config{httpd_builtin}->{https_url} || "n") eq "y") ? "https://" . $ENV{HTTP_HOST} : "http://" . $ENV{HTTP_HOST};
if(!($config{hostname})) { # called from the command line
$config{hostname} = "127.0.0.1";
$config{url} = "http://127.0.0.1";
}
}
}
$config{url} .= $config{base_url};