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

@@ -8,6 +8,7 @@
[BUG FIXES]
* Update NodeWireless entries which match both MAC and SSID found, only
* Fix SSL-proxy behaviour by using only path+query in links (W. Gould)
2.017000 - 2013-09-23

View File

@@ -307,18 +307,18 @@ App::Netdisco:
=item C<search_node>
A base url which links to the Node tab of the Search page, together with the
correct default search options set.
A path and query string which links to the Node tab of the Search page,
together with the correct default search options set.
=item C<search_device>
A base url which links to the Device tab of the Search page, together with the
correct default search options set.
A path and query string which links to the Device tab of the Search page,
together with the correct default search options set.
=item C<device_ports>
A base url which links to the Ports tab of the Device page, together with
the correct default column view options set.
A path and query sting which links to the Ports tab of the Device page,
together with the correct default column view options set.
=item C<uri_base>

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;

View File

@@ -55,7 +55,7 @@ foreach my $jobtype (keys %jobs_all, keys %jobs) {
if exists $jobs{$jobtype} and not param('device');
add_job($jobtype, param('device'), param('extra'));
redirect uri_for('/admin/jobqueue')->as_string;
redirect uri_for('/admin/jobqueue')->path;
};
}

View File

@@ -159,7 +159,7 @@ get '/device' => require_login sub {
});
if (!defined $dev) {
return redirect uri_for('/', {nosuchdevice => 1})->as_string();
return redirect uri_for('/', {nosuchdevice => 1})->path_query;
}
params->{'tab'} ||= 'details';

View File

@@ -66,7 +66,7 @@ get '/search' => require_login sub {
if (not param('tab')) {
if (not $q) {
return redirect uri_for('/')->as_string;
return redirect uri_for('/')->path;
}
# pick most likely tab for initial results
@@ -83,7 +83,7 @@ get '/search' => require_login sub {
tab => 'details',
q => ($nd->first->dns || $nd->first->ip),
f => '',
})->as_string;
})->path;
}
# multiple devices