| 1 | package Plack::Middleware::RearrangeHeaders; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use parent qw( Plack::Middleware ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use HTTP::Headers; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | ▶ | sub call { |
|
Subroutine
call: called CC=1 SCAR=0.0
Pod
documented
| |||
| 9 | 1 | my $self = shift; | |
| 10 | |||
| 11 | 1 | my $res = $self->app->(@_); | |
| 12 | 1 | ▶ | $self->response_cb($res, sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 13 | 1 | my $res = shift; | |
| 14 | |||
| 15 | 1 | my $h = HTTP::Headers->new(@{$res->[1]}); | |
| 16 | 1 | my @new_headers; | |
| 17 | 1 | ▶ | $h->scan(sub { push @new_headers, @_ }); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | 1 | $res->[1] = \@new_headers; | |
| 20 | 1 | }); | |
| 21 | } | ||
| 22 | |||
| 23 | 1 | 1; | |
| 24 | |||
| 25 | __END__ | ||