Loading index.pl +9 −10 Original line number Original line Diff line number Diff line Loading @@ -306,7 +306,7 @@ helper 'json_route_diff' => sub { sub handle_request { sub handle_request { my $self = shift; my $self = shift; my $station = $self->stash('station'); my $station = $self->stash('station'); my $via = $self->stash('via') // $self->param('via'); my $via = $self->param('via'); my @platforms = split( /,/, $self->param('platforms') // q{} ); my @platforms = split( /,/, $self->param('platforms') // q{} ); my @lines = split( /,/, $self->param('lines') // q{} ); my @lines = split( /,/, $self->param('lines') // q{} ); Loading Loading @@ -365,12 +365,12 @@ sub handle_request { return; return; } } # foo/bar used to mean "departures for foo via bar", and this is still the # foo/bar used to mean "departures for foo via bar". This is now # default. However, there are also stations named "foo/bar". So, if # deprecated, but most of these cases are handled here. # "foo" is not a valid station, try "foo/bar" instead if ( not @results and $station =~ m{/} ) { if ( not @results and $self->stash('via')) { ( $station, $via ) = split( qr{/}, $station ); $station = "$station/$via"; $self->param( station => $station ); $via = undef; $self->param( via => $via ); $data = get_results_for( $backend, $station, %opt ); $data = get_results_for( $backend, $station, %opt ); $results_ref = $data->{results}; $results_ref = $data->{results}; $errstr = $data->{errstr}; $errstr = $data->{errstr}; Loading Loading @@ -921,9 +921,8 @@ post '/_geolocation' => sub { app->defaults( layout => 'default' ); app->defaults( layout => 'default' ); get '/' => \&handle_request; get '/' => \&handle_request; get '/#station' => \&handle_request; get '/multi/*station' => \&handle_request; get '/#station/#via' => \&handle_request; get '/*station' => \&handle_request; get '/multi/#station' => \&handle_request; app->config( app->config( hypnotoad => { hypnotoad => { Loading Loading
index.pl +9 −10 Original line number Original line Diff line number Diff line Loading @@ -306,7 +306,7 @@ helper 'json_route_diff' => sub { sub handle_request { sub handle_request { my $self = shift; my $self = shift; my $station = $self->stash('station'); my $station = $self->stash('station'); my $via = $self->stash('via') // $self->param('via'); my $via = $self->param('via'); my @platforms = split( /,/, $self->param('platforms') // q{} ); my @platforms = split( /,/, $self->param('platforms') // q{} ); my @lines = split( /,/, $self->param('lines') // q{} ); my @lines = split( /,/, $self->param('lines') // q{} ); Loading Loading @@ -365,12 +365,12 @@ sub handle_request { return; return; } } # foo/bar used to mean "departures for foo via bar", and this is still the # foo/bar used to mean "departures for foo via bar". This is now # default. However, there are also stations named "foo/bar". So, if # deprecated, but most of these cases are handled here. # "foo" is not a valid station, try "foo/bar" instead if ( not @results and $station =~ m{/} ) { if ( not @results and $self->stash('via')) { ( $station, $via ) = split( qr{/}, $station ); $station = "$station/$via"; $self->param( station => $station ); $via = undef; $self->param( via => $via ); $data = get_results_for( $backend, $station, %opt ); $data = get_results_for( $backend, $station, %opt ); $results_ref = $data->{results}; $results_ref = $data->{results}; $errstr = $data->{errstr}; $errstr = $data->{errstr}; Loading Loading @@ -921,9 +921,8 @@ post '/_geolocation' => sub { app->defaults( layout => 'default' ); app->defaults( layout => 'default' ); get '/' => \&handle_request; get '/' => \&handle_request; get '/#station' => \&handle_request; get '/multi/*station' => \&handle_request; get '/#station/#via' => \&handle_request; get '/*station' => \&handle_request; get '/multi/#station' => \&handle_request; app->config( app->config( hypnotoad => { hypnotoad => { Loading