RT 4.2.11, ticket#13852
[freeside.git] / rt / t / data / plugins / RT-Extension-PSGIWrap / lib / RT / Extension / PSGIWrap.pm
1 package RT::Extension::PSGIWrap;
2
3 use base 'Plack::Middleware';
4
5 sub call {
6     my ( $self, $env ) = @_;
7     my $res = $self->app->($env);
8     return $self->response_cb( $res, sub {
9         my $headers = shift->[1];
10         Plack::Util::header_set($headers, 'X-RT-PSGIWrap' => '1');
11     } );
12 }
13
14 sub PSGIWrap { return shift->wrap(@_) }
15
16 1;