This allows using MakeSecureURL() outside the CGI scripts. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- testbot/lib/WineTestBot/Utils.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/testbot/lib/WineTestBot/Utils.pm b/testbot/lib/WineTestBot/Utils.pm index 25c60d53f..63e8f5328 100644 --- a/testbot/lib/WineTestBot/Utils.pm +++ b/testbot/lib/WineTestBot/Utils.pm @@ -51,13 +51,8 @@ sub MakeSecureURL($) { my ($URL) = @_; - my $Protocol = "http"; - if ($UseSSL || SecureConnection()) - { - $Protocol .= "s"; - } - - return $Protocol . "://" . $ENV{"HTTP_HOST"} . $URL; + my $Protocol = ($UseSSL || SecureConnection()) ? "https://" : "http://"; + return $Protocol . ($ENV{"HTTP_HOST"} || $WebHostName) . $URL; } sub DurationToString($;$) -- 2.20.1