diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-10-04 22:51:42 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-10-04 22:51:42 +0200 |
commit | 43cf9da87b82548055c13dd68873441c64b0850c (patch) | |
tree | f9a3fcc67373538b1958d3b7ab21ca040e1da6da | |
parent | 9eee6acb5fae593c2789be0576cfc8aff95263c9 (diff) |
index: do not show parameters with default values
-rw-r--r-- | index.pl | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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); } } |