[Rt-devel] lib/RT/Interface/Web.pm::Redirect() broken...?

Matthew Sullivan matthew at sorbs.net
Wed Dec 13 05:40:26 EST 2006


Matthew Sullivan wrote:
> My fix until someone comes up with something better is:
>
> sub Redirect {
>    my $redir_to = shift;    untie $HTML::Mason::Commands::session;
>    my $uri = URI->new($redir_to);
>    my $server_uri = URI->new($RT::WebURL);
>  
>    # If the user is coming in via a non-canonical
>    # hostname, don't redirect them to the canonical host,
>    # it will just upset them (and invalidate their credentials)
>    if ($uri->host  eq $server_uri->host &&
>        $uri->port eq $server_uri->port) {
>            $uri->host($ENV{'HTTP_HOST'});
>            $uri->port($ENV{'SERVER_PORT'});
>            $uri->scheme((exists $ENV{'SCRIPT_URI'} && 
> $ENV{'SCRIPT_URI'} =~ /^https:/) ? "https" : "http");
>        }
>          $HTML::Mason::Commands::m->redirect($uri->canonical);
>    $HTML::Mason::Commands::m->abort;
> }
and that still screws up...

suggestions welcome.

/ Mat


More information about the Rt-devel mailing list