small adjustments to session middleware
This commit is contained in:
parent
18525e7c1b
commit
29428d7d40
1 changed files with 2 additions and 3 deletions
|
|
@ -3,10 +3,8 @@ use strict;
|
||||||
use parent qw(Plack::Middleware);
|
use parent qw(Plack::Middleware);
|
||||||
use WebGUI::Config;
|
use WebGUI::Config;
|
||||||
use WebGUI::Session;
|
use WebGUI::Session;
|
||||||
use WebGUI::Utility ();
|
|
||||||
use Try::Tiny;
|
use Try::Tiny;
|
||||||
use WebGUI::Middleware::HTTPExceptions;
|
use WebGUI::Middleware::HTTPExceptions;
|
||||||
use Plack::Middleware::SimpleLogger;
|
|
||||||
use Plack::Util::Accessor qw( config );
|
use Plack::Util::Accessor qw( config );
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
@ -37,6 +35,7 @@ sub call {
|
||||||
|
|
||||||
# Logger fallback
|
# Logger fallback
|
||||||
if (!$env->{'psgix.logger'}) {
|
if (!$env->{'psgix.logger'}) {
|
||||||
|
require Plack::Middleware::SimpleLogger;
|
||||||
$app = Plack::Middleware::SimpleLogger->wrap( $app );
|
$app = Plack::Middleware::SimpleLogger->wrap( $app );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,7 +86,7 @@ sub canShowDebug {
|
||||||
if $ips eq '';
|
if $ips eq '';
|
||||||
$ips =~ s/\s+//g;
|
$ips =~ s/\s+//g;
|
||||||
my @ips = split /,/, $ips;
|
my @ips = split /,/, $ips;
|
||||||
my $ok = WebGUI::Utility::isInSubnet($session->env->getIp, [ @ips ] );
|
my $ok = Net::CIDR::Lite->new(@ips)->find($env->{REMOTE_ADDR});
|
||||||
return $ok;
|
return $ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue