[PATCH] testbot/web: Always check the https connection the same way.

Francois Gouget fgouget at codeweavers.com
Wed Sep 25 01:52:33 CDT 2019


The standard way the TestBot checks the https connection is with
'$UseSSL && ! SecureConnection())' so use that form in CheckSecurePage()
too. This actually simplifies it too.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/lib/WineTestBot/CGI/PageBase.pm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm
index d1442c1e5..c1a8c8cbf 100644
--- a/testbot/lib/WineTestBot/CGI/PageBase.pm
+++ b/testbot/lib/WineTestBot/CGI/PageBase.pm
@@ -73,12 +73,10 @@ sub CheckSecurePage($$)
 {
   my ($self, $Page) = @_;
 
-  if (! $UseSSL || SecureConnection())
+  if ($UseSSL && ! SecureConnection())
   {
-    return;
+    $self->Redirect($Page, MakeSecureURL($ENV{"REQUEST_URI"}));
   }
-
-  $self->Redirect($Page, MakeSecureURL($ENV{"REQUEST_URI"}));
 }
 
 sub GenerateHttpHeaders($)
-- 
2.20.1




More information about the wine-devel mailing list