[Rt-devel] lib/RT/Interface/Web.pm::Redirect() broken...?
Matthew Sullivan
matthew at sorbs.net
Thu Dec 14 01:01:13 EST 2006
Jesse Vincent wrote:
> How is that screwing up?
>
ended up with: http://rt.sorbs.net:443/....
I'm thinking that the entire rewrite code should be
"turn-offable"(RT_Config.pm var?) ... It would work fine if I was
running multiple different servers etc... problem is I'm running one
server on 2 ports, one ssl and one non ssl ... (it would also be nice to
tie it into the cookie as well so that the login cookie is valid for
http and https).
Regards,
Mat
> ------- 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