fix: Pluggable URL handlers didn't work with gateways other than /.
This commit is contained in:
parent
bff94329dc
commit
215914590a
3 changed files with 8 additions and 2 deletions
|
|
@ -63,9 +63,14 @@ sub handler {
|
|||
my $server = Apache2::ServerUtil->server; #instantiate the server api
|
||||
my $config = WebGUI::Config->new($server->dir_config('WebguiRoot'), $configFile); #instantiate the config object
|
||||
my $error = "";
|
||||
my $matchUri = $request->uri;
|
||||
my $gateway = $config->get("gateway");
|
||||
warn $matchUri;
|
||||
$matchUri =~ s{^$gateway(.*)}{/$1};
|
||||
warn $matchUri;
|
||||
foreach my $handler (@{$config->get("urlHandlers")}) {
|
||||
my ($regex) = keys %{$handler};
|
||||
if ($request->uri =~ m{$regex}i) {
|
||||
if ($matchUri =~ m{$regex}i) {
|
||||
my $output = eval { WebGUI::Pluggable::run($handler->{$regex}, "handler", [$request, $server, $config]) };
|
||||
if ($@) {
|
||||
die $@ if ($@ =~ "^fatal:");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue