Ver código fonte

fix default route

George Baugh 5 meses atrás
pai
commit
7a6dd6b172
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      lib/TCMS.pm

+ 3 - 1
lib/TCMS.pm

@@ -48,6 +48,8 @@ sub build_routes {
     my $data   = Trog::Data->new($conf);
     my %routes = %{ _routes($data) };
 
+    my $default_route = $routes{default}{callback};
+
     # Transform 'method' / 'callback' to new scheme
     my %routes_adj;
     foreach my $k (keys(%routes)) {
@@ -74,7 +76,7 @@ sub build_routes {
             log_init("$tpsgi->{log_dir}/tpsgi.log", $tpsgi->{verbose} ? 'debug' : 'info');
 
             # Let's open up our default route if needed before we bother thinking any harder
-            return $routes{default}{callback}->($query) unless -f "config/setup";
+            return $default_route->($query) unless -f "config/setup";
 
             # Set the urchin parameters if necessary.
             %$Trog::Log::DBI::urchin = map { $_ => delete $query->{$_} } qw{utm_source utm_medium utm_campaign utm_term utm_content};