[Catalyst] Catalyst::Plugin::Server::XMLRPC prefix option broken under lighttpd

Alex Pavlovic alex at taskforce-1.com
Thu Jul 20 07:02:29 CEST 2006


Hi,

Just an update on the situation. The prefix is broken only when your entry 
point ( path ) and prefix are the same. As shown in example sent earlier. 

This works under standalone myapp_server.pl but not under fastcgi because CGI 
engine sets the base path to "$ENV{SCRIPT_NAME}" in "prepare_path", this in 
turn causes "$location" in Catalyst::Request::path to be set to this, well 
you guess what happens afterwards "$path =~ s/^(\Q$location\E)?//;", a little 
bit of substitution which takes the prefix out, and causes xmlrpc method not 
to be found. 

So to cut the story short, don't use the same prefix and entry point name like 
I did and you will save yourself time debugging.


Thanks.

On Wednesday 19 July 2006 00:12, Alex Pavlovic wrote:
> Hi,
>
> Catalyst versions affected: 5.69/5.7
> Server: lighttpd 1.4.11_1
>
> For the test case assume the following:
>
> package MyApp;
> __PACKAGE__->config(
> 	xmlrpc => {
> 		path => 'xmlrpc',
> 		prefix => 'xmlrpc',
> 		show_errors => 1
> 	}
> );
> ...
>
> package MyApp::Controller::XMLRPC::Session;
> ....
> sub authenticate : XMLRPC {
> 	...
> }
>
> When using myapp_server.pl script, the entry is set to
> http://localhost:3000/xmlrpc, so when call for 'session.authenticate', it
> will dispatch properly to XMLRPC::Session::authenticate sub.
>
> However once the code executes under fastcgi and lighttpd, the dispatch
> only works when call is done with xmlrpc prefix, such
> as 'xmlrpc.session.authenticate', when the call is done
> as 'session.authenticate', it complains about not finding the method that
> can handle the request. This should work however with the correct prefix
> being set.
>
> I noticed in Catalyst::Plugin::Server::XMLRPC::_deserialize_xml that
> forward path is being set correctly at $self->forward_path( $fwd_path ),
> with the specified prefix, so I am wondering if something else outside the
> plugin is causing the problem that's related to fcgi environment.
>
>
> Thanks.
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/



More information about the Catalyst mailing list