Blast-Radius Aware AI Code Review for Business-Critical Systems
LiveReview LiveReview Explore LiveReview

Plack::Middleware::SimpleContentFilter - Filters response content

Author

       Tatsuhiko Miyagawa

perl v5.38.2                                       2024-01-20             Plack::Middlewa...leContentFilter(3pm)

Description

Thismiddlewareshouldbeconsideredasademo.RunningthisagainstyourapplicationmightbreakyourHTMLunlessyoucodethefiltercallbackcarefully.

       Plack::Middleware::SimpleContentFilter is a simple content text filter to run against response body. This
       middleware is only enabled against responses with "text/*" Content-Type.

Name

       Plack::Middleware::SimpleContentFilter - Filters response content

Synopsis

         use Plack::Builder;

         my $app = sub {
             return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ];
         };

         builder {
             enable "Plack::Middleware::SimpleContentFilter",
                 filter => sub { s/Foo/Bar/g; };
             $app;
         };

See Also