Unverified Commit a4d60a03 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

pass version via defaults

parent 51350ffe
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@ sub startup {
	);
	);


	chomp $self->config->{version};
	chomp $self->config->{version};
	$self->defaults( version => $self->config->{version} // 'UNKNOWN' );


	# Generally, the reverse proxy handles compression.
	# Generally, the reverse proxy handles compression.
	# Also, Mojolicious compression breaks legacy callback-based JSON endpoints
	# Also, Mojolicious compression breaks legacy callback-based JSON endpoints
+0 −1
Original line number Original line Diff line number Diff line
@@ -70,7 +70,6 @@ sub about {
	$self->render(
	$self->render(
		'about',
		'about',
		hide_opts => 1,
		hide_opts => 1,
		version   => $self->config->{version}
	);
	);
}
}


+0 −5
Original line number Original line Diff line number Diff line
@@ -131,7 +131,6 @@ sub handle_no_results_json {
	if ($errstr) {
	if ($errstr) {
		$json = {
		$json = {
			api_version => $api_version,
			api_version => $api_version,
			version     => $self->config->{version},
			error       => $errstr,
			error       => $errstr,
		};
		};
	}
	}
@@ -143,7 +142,6 @@ sub handle_no_results_json {
		{
		{
			$json = {
			$json = {
				api_version => $api_version,
				api_version => $api_version,
				version     => $self->config->{version},
				error       => 'ambiguous station code/name',
				error       => 'ambiguous station code/name',
				candidates  => \@candidates,
				candidates  => \@candidates,
			};
			};
@@ -151,7 +149,6 @@ sub handle_no_results_json {
		else {
		else {
			$json = {
			$json = {
				api_version => $api_version,
				api_version => $api_version,
				version     => $self->config->{version},
				error       => ( $errstr // "Got no results for '$station'" )
				error       => ( $errstr // "Got no results for '$station'" )
			};
			};
		}
		}
@@ -403,7 +400,6 @@ sub handle_request {


	$self->stash( departures => [] );
	$self->stash( departures => [] );
	$self->stash( title      => 'DBF' );
	$self->stash( title      => 'DBF' );
	$self->stash( version    => $self->config->{version} );


	if ( not( $template ~~ [qw[app infoscreen json multi single text]] ) ) {
	if ( not( $template ~~ [qw[app infoscreen json multi single text]] ) ) {
		$template = 'app';
		$template = 'app';
@@ -1110,7 +1106,6 @@ sub train_details {


	$self->stash( departures => [] );
	$self->stash( departures => [] );
	$self->stash( title      => 'DBF' );
	$self->stash( title      => 'DBF' );
	$self->stash( version    => $self->config->{version} );


	my $res = {
	my $res = {
		train_type      => undef,
		train_type      => undef,