Plack::Middleware::LimitRequest - HTTP Request Limitation for Plack apps
use Plack::Builder; my $app = sub { ... }; builder { enable 'LimitRequest', body => 102400, fields => 50, field_size => 4094, line => 4094 ; $app; };
Plack::Middleware::LimitRequest provides HTTP request size limitation for HTTP request body, the number of request header fields, size of an HTTP request header field and size of a client's HTTP request-line. It works similar to Apache core directives, LimitRequestBody, LimitRequestFields, LimitRequestFieldSize and LimitRequestLine. This is useful to protect against kind of DDoS attacks.
LimitRequestBody
LimitRequestFields
LimitRequestFieldSize
LimitRequestLine
If your application is working behind some Apache reverse proxy servers (using mod_proxy module), most of directives above works correctly, so you should configure them on the Apache configuration. But, only LimitRequestBody directive does not work for proxied requests. This module solves, especially in the case that demand to limit for the size of HTTP request body.
It allows to set a limit on the allowed size of an HTTP request message body. Default is 0. If you don't want to limit the size, set this argument to 0 (means unlimited) or unset (omit it on your .psgi file).
0
It allows to modify the limit on the number of request header fields allowed in an HTTP request. Default is 100. If you don't want to limit the number, set this argument to 0 (means unlimited).
100
It allows to set the limit on the allowed size of an HTTP request header field. Default is 8190. If you don't want to limit the size, set this argument to 0 (means unlimited).
8190
It allows to set the limit on the allowed size of a client's HTTP request-line. Since the request-line consists of the HTTP method, URI, and protocol version. Default is 8190. If you don't want to limit the size, set this argument to 0 (means unlimited).
Koichi Taniguchi (a.k.a. nipotan) <taniguchi@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://httpd.apache.org/docs/2.4/en/mod/core.html
To install Plack::Middleware::LimitRequest, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::LimitRequest
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::LimitRequest
For more information on module installation, please visit the detailed CPAN module installation guide.