diff options
author | franck cuny <franck@lumberjaph.net> | 2010-04-28 09:18:39 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-04-28 09:18:39 +0200 |
commit | 22a2333a63dc7703c93342ef9824b7d22e716316 (patch) | |
tree | 0df06881ef313997bfdc4dd07edc374862c1c641 /lib/Plack | |
parent | POD fix (diff) | |
download | plack-middleware-throttle-22a2333a63dc7703c93342ef9824b7d22e716316.tar.gz |
Checking in changes prior to tagging of version 0.01. Changelog diff is: master
Diffstat (limited to 'lib/Plack')
-rw-r--r-- | lib/Plack/Middleware/Throttle.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Plack/Middleware/Throttle.pm b/lib/Plack/Middleware/Throttle.pm index 3100325..d3a8fd1 100644 --- a/lib/Plack/Middleware/Throttle.pm +++ b/lib/Plack/Middleware/Throttle.pm @@ -98,7 +98,7 @@ sub is_black_listed { sub path_is_throttled { my ( $self, $env ) = @_; - return 0 if !$self->has_path; + return 1 if !$self->has_path; my $path_match = $self->path; my $path = $env->{PATH_INFO}; @@ -106,7 +106,7 @@ sub path_is_throttled { my $matched = 'CODE' eq ref $path_match ? $path_match->($_) : $_ =~ $path_match; $matched ? return 1 : return 0; } - return 0; + return 1; } sub forbiden { @@ -161,7 +161,7 @@ Plack::Middleware::Throttle - A Plack Middleware for rate-limiting incoming HTTP enable "Throttle::Hourly", max => 2, backend => Plack::Middleware::Throttle::Backend::Hash->new(), - path => qr{^/foo}; + path => qr{^/api}; sub { [ '200', [ 'Content-Type' => 'text/html' ], ['hello world'] ] }; }; |