---
name: "Plack::Middleware::SimpleContentFilter"
section: "3pm"
platform: "linux"
package: "libplack-perl"
version: "1.0051-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Plack::Middleware::SimpleContentFilter"
---

# Plack::Middleware::SimpleContentFilter(3pm)

Filters response content

## 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;
  };
```

## DESCRIPTION

**This middleware should be considered as a demo. Running this against** **your application might break your HTML unless you code the filter** **callback carefully**.

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.

## AUTHOR

Tatsuhiko Miyagawa
