[Catalyst] Setting $c->req->{base}

Alessio Bragadini alessio at sevenseas.org
Tue Sep 20 16:08:44 CEST 2005


On Tue, 2005-09-20 at 09:14 -0400, Andy Grundman wrote:

> I would recommend if you need to set base to something specific, that 
> you just do this in your App's begin() method:
> 
> $c->req->base( 'http://whatever/' );

I've tried this but didn't manage to make it work. That's why I asked
for directions. Is begin called after base is pushed into the request
object by Engine::*::Base?

> I don't think running the frontend on another port will make a 
> difference as the code only checks the address.  HTTPS though, good 
> point.  That will need to be handled as well.

Seems to me you're tackling the specific issue without looking at the
generic landscape. You may have all kinds of strange configurations that
need to be handled when creating self-referencing URLs, https is an
example but you may have webcal:// or some other http-based protocol or
something we don't know yet. I thought that Catalyst was about
flexibility, so I believe the right solution is to let users decide the
base part of the address.

I've sent you earlier today a patch that handles this and it's currently
working fine on my server.

-- 
Alessio Bragadini <alessio at sevenseas.org>
Sevenseas.org Hacking Community




More information about the Catalyst mailing list