1Plack::Middleware::LintU(s3e)r Contributed Perl DocumentaPtliaocnk::Middleware::Lint(3)
2
3
4

NAME

6       Plack::Middleware::Lint - Validate request and response
7

SYNOPSIS

9         use Plack::Middleware::Lint;
10
11         my $app = sub { ... }; # your app or middleware
12         $app = Plack::Middleware::Lint->wrap($app);
13
14         # Or from plackup
15         plackup -e 'enable "Lint"' myapp.psgi
16

DESCRIPTION

18       Plack::Middleware::Lint is a middleware component to validate request
19       and response environment formats. You are strongly suggested to use
20       this middleware when you develop a new framework adapter or a new PSGI
21       web server that implements the PSGI interface.
22
23       This middleware is enabled by default when you run plackup or other
24       launcher tools with the default environment development value.
25

DEBUGGING

27       Because of how this middleware works, it may not be easy to debug Lint
28       errors when you encounter one, unless you're writing a PSGI web server
29       or a framework.
30
31       For example, when you're an application developer (user of some
32       framework) and see errors like:
33
34         Body should be an array ref or filehandle at lib/Plack/Middleware/Lint.pm line XXXX
35
36       there's no clue about which line of your application produces that
37       error.
38
39       We're aware of the issue, and have a plan to spit out more helpful
40       errors to diagnose the issue. But until then, currently there are some
41       workarounds to make this easier. For now, the easiest one would be to
42       enable Plack::Middleware::REPL outside of the Lint middleware, like:
43
44         plackup -e 'enable "REPL"; enable "Lint"' app.psgi
45
46       so that the Lint errors are caught by the REPL shell, where you can
47       inspect all the variables in the response.
48

AUTHOR

50       Tatsuhiko Miyagawa
51
52       Tokuhiro Matsuno
53

SEE ALSO

55       Plack
56
57
58
59perl v5.36.0                      2022-09-12        Plack::Middleware::Lint(3)
Impressum