[PATCH 2/3] testbot: Use $WebHostName as a fallback in MakeSecureURL().

Francois Gouget fgouget at codeweavers.com
Fri Sep 20 06:56:27 CDT 2019


This allows using MakeSecureURL() outside the CGI scripts.

Signed-off-by: Francois Gouget <fgouget at 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




More information about the wine-devel mailing list