J. Shirley wrote:
If you did want to do something in Catalyst, you could create a plugin
that runs after prepare_path and modifies $c->request->path accordingly
(match off $c->req->base domain)... it'd be an interesting plugin,
that's for sure. I'm sure some of the deeper Catalyst hackers can think
of alternative, and perhaps simpler, ways to do it.
package MyApp::RequestRole::PrependHostName;
use Moose::Role;
around path => sub {
my ($orig, $self, @path) = @_;
return $self->$orig() if ! @path;
$self->$orig($self->hostname, @path));
};
package MyApp;
use Moose;
use Catalyst;
use Catalyst::App::RoleApplicator;
__PACKAGE__->apply_request_class_roles(
qw/MyApp::RequestRole::PrependHostName/
);
I think would do what you want (untested).
I am unsure if this is a sane approach however, but that has already
been covered elsewhere in the thread. :_)
Cheers
t0m
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/