Navigation Menu

Skip to content

Commit

Permalink
use the same example in the OO example, for easier comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
karenetheridge committed Apr 5, 2012
1 parent 02cd99a commit 569a4c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Plack/Middleware/Conditional.pm
Expand Up @@ -32,15 +32,15 @@ Plack::Middleware::Conditional - Conditional wrapper for Plack middleware
use Plack::Builder;
builder {
enable_if { $_[0]->{REMOTE_ADDR} eq '127.0.0.1' } 'StackTrace';
enable_if { $_[0]->{REMOTE_ADDR} eq '127.0.0.1' } 'StackTrace', force => 1;
$app;
};
# or using the OO interface:
$app = Plack::Middleware::Conditional->wrap(
$app,
condition => sub { my $env = shift; $env->{HTTP_USER_AGENT} =~ /WebKit/ },
builder => sub { Plack::Middleware::SuperAdminConsole->wrap($_[0], @args) },
condition => sub { $_[0]->{REMOTE_ADDR} eq '127.0.0.1' },
builder => sub { Plack::Middleware::StackTrace->wrap($_[0], force => 1) },
);
=head1 DESCRIPTION
Expand Down

0 comments on commit 569a4c3

Please sign in to comment.