Francois Gouget : testbot: Use $WebHostName as a fallback in MakeSecureURL().
Alexandre Julliard
julliard at winehq.org
Fri Sep 20 15:39:35 CDT 2019
Module: tools
Branch: master
Commit: 0667c75b9014990ad33d54ea4435e243c6ddb500
URL: https://source.winehq.org/git/tools.git/?a=commit;h=0667c75b9014990ad33d54ea4435e243c6ddb500
Author: Francois Gouget <fgouget at 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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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($;$)
More information about the wine-cvs
mailing list