Subject: | modules always set in scalar context |
Distribution: JSON-RPC-0.96
Perl: 5.10.1
OS: GNU/Linux (Fedora 13 beta)
JSON::RPC::Server::Apache2::handle uses $r->dir_config to retrieve RPC
modules to dispatch to but two bugs at the same time prevent more than
one value to be set:
dir_config (arg) always returns just the value of the first matching
entry for key `arg', dir_config->get (arg) (APR::Table method) must be
used to get all matching entries and return an array; furthermore the
boolean OR prevents array context so two separate statements are required.
The attached patch fixes this issue.
Best regards
Subject: | perl-JSON-RPC-0.96-scalarfix.patch |
diff -up JSON-RPC-0.96/lib/JSON/RPC/Server/Apache2.pm.scalarfix JSON-RPC-0.96/lib/JSON/RPC/Server/Apache2.pm
--- JSON-RPC-0.96/lib/JSON/RPC/Server/Apache2.pm.scalarfix 2010-04-29 16:15:46.000000000 +0200
+++ JSON-RPC-0.96/lib/JSON/RPC/Server/Apache2.pm 2010-04-29 16:36:49.000000000 +0200
@@ -26,7 +26,8 @@ sub handler {
$s->{path_info} = $r->path_info;
- my @modules = $r->dir_config('dispatch') || $r->dir_config('dispatch_to');
+ my @modules = $r->dir_config->get('dispatch');
+ @modules = $r->dir_config->get('dispatch_to') unless @modules;
$s->return_die_message( $r->dir_config('return_die_message') );