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

Jesse Vincent jesse at bestpractical.com
Wed Dec 13 12:45:11 EST 2006


How is that screwing up?

------- Original message -------
From: Matthew Sullivan <matthew at sorbs.net>
Sent: 12/13,  21:40

> 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
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
> 



More information about the Rt-devel mailing list