Francois Gouget : testbot: Use $WebHostName as a fallback in MakeSecureURL().
Module: tools Branch: master Commit: 0667c75b9014990ad33d54ea4435e243c6ddb500 URL: https://source.winehq.org/git/tools.git/?a=commit;h=0667c75b9014990ad33d54ea... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Fri Sep 20 13:56:27 2019 +0200 testbot: Use $WebHostName as a fallback in MakeSecureURL(). This allows using MakeSecureURL() outside the CGI scripts. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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 25c60d5..63e8f53 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($;$)
participants (1)
-
Alexandre Julliard