Fix SSL-proxy behaviour by using only path+query in links (W. Gould)

This commit is contained in:
Oliver Gorwits
2013-10-06 17:37:28 +01:00
parent a4e2375cdd
commit 4d9f16db3a
6 changed files with 16 additions and 10 deletions

View File

@@ -48,6 +48,7 @@ if (setting('extra_web_plugins') and ref [] eq ref setting('extra_web_plugins'))
# workaround for https://github.com/PerlDancer/Dancer/issues/935
hook after_error_render => sub { setting('layout' => 'main') };
# this hook should be loaded _after_ all plugins
hook 'before_template' => sub {
my $tokens = shift;
@@ -61,6 +62,10 @@ hook 'before_template' => sub {
# access to logged in user's roles
$tokens->{user_has_role} = sub { user_has_role(@_) };
# fix Plugin Template Variables to be only path+query
$tokens->{$_} = $tokens->{$_}->path_query
for qw/search_node search_device device_ports/;
# allow very long lists of ports
$Template::Directive::WHILE_MAX = 10_000;