Plack::...tLength(3)
π Plack::Middleware::ContentLength β or as the man page header calls it, Plack::...tLength(3) β¨
okay bestie, gather round, because this one is a little slice of Perl-flavored heaven from the User Contributed Perl Documentation collection π«Ά
πΈ NAME πΈ
Plack::Middleware::ContentLength β it adds the Content-Length header for you, automatically, no cap π
β¨ SYNOPSIS β¨
like, here's the vibe. first up, in your app.psgi:
# in app.psgi
builder {
enable "Plack::Middleware::ContentLength";
$app;
}
or, if you're doing it in Plack::Handler::* instead:
# Or in Plack::Handler::*
$app = Plack::Middleware::ContentLength->wrap($app);
see? two ways, both iconic, pick your fighter π
π¦ DESCRIPTION π¦
Plack::Middleware::ContentLength is a middleware that automatically adds the "Content-Length" header when it's appropriate β okay so what counts as appropriate? literally: when the response has a content body with a calculable size. and what has a calculable size, you ask? an array of chunks, or a real filehandle. that's it, that's the tea β
and here's the lowkey underrated part: this middleware can also be used as a library from PSGI server implementations π so instead of setting Content-Length at the end user level, the server implementations can just set it themselves. delegation, but make it slay π
π AUTHOR π
Tatsuhiko Miyagawa β the icon, the moment, the main character π
π SEE ALSO π
Rack::ContentLengthβ yes bestie, the Rack girlies have one too, we're all connected π¦
fr fr, that's the whole page. every flag, every behavior, every vibe β all accounted for, no details ghosted π
and that's a wrap, my love! πΈ this lil' page came to you courtesy of perl v5.42.3, dated 2026-10-18, filed under Plack::...tLength(3). obsessed with her. periodt π
β¨
π¦ where this page comes from
- fedora 43: perl-Plack 1.0055-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Plack 1.0055-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms