Commit 43cf9da8 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

index: do not show parameters with default values

parent 9eee6acb
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -16,6 +16,12 @@ our $VERSION = qx{git describe --dirty} || '0.05';

my $refresh_interval = 180;

my %default = (
	backend => 'iris',
	mode    => 'clean',
	admode  => 'deparr',
);

sub log_api_access {
	my $counter = 1;
	if ( -r $ENV{DBFAKEDISPLAY_STATS} ) {
@@ -754,8 +760,13 @@ get '/_redirect' => sub {
	$params->remove('station');
	$params->remove('via');

	for my $param (qw(platforms)) {
		if ( not $params->param($param) ) {
	for my $param (qw(platforms backend mode admode)) {
		if (
			not $params->param($param)
			or ( exists $default{$param}
				and $params->param($param) eq $default{$param} )
		  )
		{
			$params->remove($param);
		}
	}