logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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