Skip to content
Permalink
Browse files

Add some path munging based on what Plack::App::URLMap does for mount…

…ing the demo sites.
  • Loading branch information...
perlDreamer committed Feb 18, 2012
1 parent 0337d6a commit 09dac7fe4fb08e28f13fc75a88ed6467dd8a1184
Showing with 12 additions and 1 deletion.
  1. +12 −1 wre/lib/WRE/WebguiDemo.pm
@@ -38,7 +38,18 @@ sub call {
local $ENV{WEBGUI_CONFIG} = $webgui_config;
my $psgi = WebGUI::Paths->defaultPSGI;
my $app = Plack::Util::load_psgi($psgi);
return Plack::Util::run_app($app, $env);

my $orig_path_info = my $path = $env->{PATH_INFO};
my $orig_script_name = $env->{SCRIPT_NAME};

$path =~ s/\Q$id\E//;

$env->{PATH_INFO} = $path;
$env->{SCRIPT_NAME} .= $id;
return $self->response_cb($app->($env), sub {
$env->{PATH_INFO} = $orig_path_info;
$env->{SCRIPT_NAME} = $orig_script_name;
});
}
# Extras can be served from nginx
elsif ($r->uri->path eq "/create") {

0 comments on commit 09dac7f

Please sign in to comment.
You can’t perform that action at this time.