Permalink
Browse files

use the same example in the OO example, for easier comparison

  • Loading branch information...
1 parent 02cd99a commit 569a4c3c45406157e7e724d4c276f6f71f63076a @karenetheridge karenetheridge committed Apr 5, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Plack/Middleware/Conditional.pm
@@ -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

0 comments on commit 569a4c3

Please sign in to comment.