[tools] testbot/cgi: Remove the Page parameter from PageBase's Redirect().

Francois Gouget fgouget at codeweavers.com
Mon Mar 28 10:28:45 CDT 2022


PageBase::Redirect() does not use the Page parameter and there is no
reason for it to need that parameter since it has $self->{Request}
and thus can already get any relevant HTTP request information.
CheckSecurePage() only has a $Page parameter in order to pass it to
Redirect() and the CheckSecurePage() callers never provide the $Page
parameter anyway.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/lib/ObjectModel/CGI/Page.pm     |  2 +-
 testbot/lib/WineTestBot/CGI/PageBase.pm | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/testbot/lib/ObjectModel/CGI/Page.pm b/testbot/lib/ObjectModel/CGI/Page.pm
index d5988803c..85e94b379 100644
--- a/testbot/lib/ObjectModel/CGI/Page.pm
+++ b/testbot/lib/ObjectModel/CGI/Page.pm
@@ -248,7 +248,7 @@ sub Redirect($$)
 {
   my ($self, $Location) = @_;
 
-  return $self->{PageBase}->Redirect($self, $Location);
+  return $self->{PageBase}->Redirect($Location);
 }
 
 
diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm
index 6d94ae967..aa90245cf 100644
--- a/testbot/lib/WineTestBot/CGI/PageBase.pm
+++ b/testbot/lib/WineTestBot/CGI/PageBase.pm
@@ -92,7 +92,7 @@ sub new($$$$@)
         ! $Session->User->HasRole($RequiredRole))
     {
       my $LoginURL = "/Login.pl?Target=" . uri_escape($ENV{"REQUEST_URI"});
-      exit($self->Redirect($Page, MakeSecureURL($LoginURL)));
+      exit($self->Redirect(MakeSecureURL($LoginURL)));
     }
   }
 
@@ -253,9 +253,9 @@ sub SessionActive($)
   return !1;
 }
 
-sub Redirect($$$)
+sub Redirect($$)
 {
-  my ($self, $Page, $Location) = @_;
+  my ($self, $Location) = @_;
 
   $self->SetCookies();
   if (substr($Location, 0, 4) ne "http")
@@ -278,13 +278,13 @@ sub Redirect($$$)
   return 0; # a suitable exit code
 }
 
-sub CheckSecurePage($$)
+sub CheckSecurePage($)
 {
-  my ($self, $Page) = @_;
+  my ($self) = @_;
 
   if ($UseSSL && ! SecureConnection())
   {
-    exit($self->Redirect($Page, MakeSecureURL($ENV{"REQUEST_URI"})));
+    exit($self->Redirect(MakeSecureURL($ENV{"REQUEST_URI"})));
   }
 }
 
-- 
2.30.2




More information about the wine-devel mailing list