Module: tools Branch: master Commit: 4a2fb45b2c6ae9b6b9b9bce256112ea233a898f9 URL: https://source.winehq.org/git/tools.git/?a=commit;h=4a2fb45b2c6ae9b6b9b9bce2... Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Mon Mar 28 17:28:45 2022 +0200 testbot/cgi: Remove the Page parameter from PageBase's Redirect(). 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(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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 d598880..85e94b3 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 20e8a2c..cab14e1 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"}))); } }