Browse files

Clean up

  • Loading branch information...
1 parent 6708edf commit 70702b9a5c15928b0cd2ed4abd9388dcead0b0b2 @aklaswad aklaswad committed Feb 10, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 mt.psgi
View
7 mt.psgi
@@ -153,15 +153,17 @@ my %CGI_SCRIPTS = (
wizard => 'mt-wizard.cgi',
check => 'mt-check.cgi', # TBD: This will fail since no entry is in core registry.
upgrade => MT->config->UpgradeScript,
- xmlrpc => MT->config->XMLRPCScript,
+ xmlrpc => MT->config->XMLRPCScript,
);
my $urlmap = Plack::App::URLMap->new;
for my $id ( keys %DAEMON_SCRIPTS ) {
my $app = MT->registry( applications => $id ) or next;
my $handler = $app->{handler};
my $path = $DAEMON_SCRIPTS{$id};
- my $base = $id eq 'cms' ? MT->config->AdminCGIPath : MT->config->CGIPath;
+ my $base = $id eq 'cms' ? MT->config->AdminCGIPath || MT->config->CGIPath
+ : MT->config->CGIPath
+ ;
$base =~ s!^https?://[^/]*/!/!;
$base .= '/' unless $base =~ m!/$!;
$path = $base . $path;
@@ -176,4 +178,5 @@ for my $id ( keys %CGI_SCRIPTS ) {
my $filepath = File::Spec->catfile( $FindBin::Bin, $file );
$urlmap->map( $url, $mt_cgi->( $filepath ) );
}
+
$urlmap->to_app;

0 comments on commit 70702b9

Please sign in to comment.