Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Post-login redirection problem

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


bg271828 at yahoo

May 14, 2008, 8:29 AM

Post #1 of 3 (248 views)
Permalink
Post-login redirection problem

Hi,

I just upgraded some packages on my server, including some versions of Catalyst.
Now Im getting problems after i log in a user. Im using the RequireSSL plugin, but
now, after a user logs in successfully, instead of going to http://www.mysite.com/myapp/, it goes to http://www.mysite.com:443/myapp/user/http://www.mysite.com/myapp. And then
I get the message "Bad Request...your speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please."

How do i fix this? My login routines are simple and mostly copied from the docs.

Thanx!

Jen


moseley at hank

May 14, 2008, 10:51 AM

Post #2 of 3 (230 views)
Permalink
Re: Post-login redirection problem [In reply to]

On Wed, May 14, 2008 at 08:29:00AM -0700, Dr. Jennifer Nussbaum wrote:
> Hi,
>
> I just upgraded some packages on my server, including some versions
> of Catalyst. Now Im getting problems after i log in a user. Im
> using the RequireSSL plugin, but now, after a user logs in
> successfully, instead of going to http://www.mysite.com/myapp/, it
> goes to
> http://www.mysite.com:443/myapp/user/http://www.mysite.com/myapp.
> And then I get the message "Bad Request...your speaking plain HTTP
> to an SSL-enabled server port. Instead use the HTTPS scheme to
> access this URL, please."

Sure you didn't end up down-grading Catalyst::Engine::Apache?

At one point it only would remove port 80 but in recent versions it
removes both 80 and 443:

if ( $port !~ /^(?:80|443)$/ && $host !~ /:/ ) {
$host .= ":$port";
}

The old version would have left the 443 on the url.

My version has this, but I think I added that to my copy of 1.11

unless ( $host =~ /:/ ) {
$host .= ":$port"
if ( $c->req->secure && $port != 443 )
|| ( !$c->req->secure && $port != 80 )
}


Hum, I see I have a hacked version of RequireSSL that creates a URI
object and then sets:

$uri->scheme( $scheme );
$uri->port( undef );

if I don't have a secure and non-secure host setup in my config (i.e.
my host name is same for ssl and non-ssl).




--
Bill Moseley
moseley[at]hank.org


_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


bg271828 at yahoo

May 14, 2008, 12:53 PM

Post #3 of 3 (229 views)
Permalink
Re: Post-login redirection problem [In reply to]

Bill Moseley <moseley[at]hank.org> wrote: On Wed, May 14, 2008 at 08:29:00AM -0700, Dr. Jennifer Nussbaum wrote:
> Hi,
>
> I just upgraded some packages on my server, including some versions
> of Catalyst. Now Im getting problems after i log in a user. Im
> using the RequireSSL plugin, but now, after a user logs in
> successfully, instead of going to http://www.mysite.com/myapp/, it
> goes to
> http://www.mysite.com:443/myapp/user/http://www.mysite.com/myapp.
> And then I get the message "Bad Request...your speaking plain HTTP
> to an SSL-enabled server port. Instead use the HTTPS scheme to
> access this URL, please."

Sure you didn't end up down-grading Catalyst::Engine::Apache?

At one point it only would remove port 80 but in recent versions it
removes both 80 and 443:Hey, i must have missed that for some reason. Upgrading fixes the port problem.

But i do still have the double-URL problem which may be something im doing.
(But it did change recnetly....)

My login system (i copied this from somewhere) works like this: in my Root
controller, if there's no user, i set

$c->session->{original_uri} = $c->req->uri;

and then i redirect to the login page. Then in the login routine, if the login is successful:

my $redirect = $c->session->{original_uri};
$c->session->{original_uri} = undef;
$c->res->redirect( $c->uri_for("$redirect")); # stringify

But this redirects to something with that weird double URL (but without the 443
problem at least).

Is this something thats changed recently? What should i be doing to get this behaviour?

Thanx again!

Jen

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.