.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Plack::Middleware::Lint 3pm" .TH Plack::Middleware::Lint 3pm 2024-01-20 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Plack::Middleware::Lint \- Validate request and response .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Plack::Middleware::Lint; \& \& my $app = sub { ... }; # your app or middleware \& $app = Plack::Middleware::Lint\->wrap($app); \& \& # Or from plackup \& plackup \-e \*(Aqenable "Lint"\*(Aq myapp.psgi .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Plack::Middleware::Lint is a middleware component to validate request and response environment formats. You are strongly suggested to use this middleware when you develop a new framework adapter or a new PSGI web server that implements the PSGI interface. .PP This middleware is enabled by default when you run plackup or other launcher tools with the default environment \fIdevelopment\fR value. .SH DEBUGGING .IX Header "DEBUGGING" Because of how this middleware works, it may not be easy to debug Lint errors when you encounter one, unless you're writing a PSGI web server or a framework. .PP For example, when you're an application developer (user of some framework) and see errors like: .PP .Vb 1 \& Body should be an array ref or filehandle at lib/Plack/Middleware/Lint.pm line XXXX .Ve .PP there's no clue about which line of \fIyour application\fR produces that error. .PP We're aware of the issue, and have a plan to spit out more helpful errors to diagnose the issue. But until then, currently there are some workarounds to make this easier. For now, the easiest one would be to enable Plack::Middleware::REPL outside of the Lint middleware, like: .PP .Vb 1 \& plackup \-e \*(Aqenable "REPL"; enable "Lint"\*(Aq app.psgi .Ve .PP so that the Lint errors are caught by the REPL shell, where you can inspect all the variables in the response. .SH AUTHOR .IX Header "AUTHOR" Tatsuhiko Miyagawa .PP Tokuhiro Matsuno .SH "SEE ALSO" .IX Header "SEE ALSO" Plack