line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Middleware::Header; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
1597
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
127
|
|
4
|
3
|
|
|
3
|
|
83
|
use 5.008_001; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
124
|
|
5
|
3
|
|
|
3
|
|
913
|
use parent qw(Plack::Middleware); |
|
3
|
|
|
|
|
335
|
|
|
3
|
|
|
|
|
21
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(set append unset)); |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
22043
|
use Plack::Util; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
804
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub call { |
14
|
12
|
|
|
12
|
1
|
58062
|
my $self = shift; |
15
|
12
|
|
|
|
|
60
|
my $res = $self->app->(@_); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$self->response_cb( |
18
|
|
|
|
|
|
|
$res, |
19
|
|
|
|
|
|
|
sub { |
20
|
12
|
|
|
12
|
|
277
|
my $res = shift; |
21
|
12
|
|
|
|
|
24
|
my $headers = $res->[1]; |
22
|
|
|
|
|
|
|
|
23
|
12
|
100
|
|
|
|
32
|
if ( $self->set ) { |
24
|
6
|
|
|
|
|
46
|
Plack::Util::header_iter($self->set, sub {Plack::Util::header_set($headers, @_)}); |
|
6
|
|
|
|
|
101
|
|
25
|
|
|
|
|
|
|
} |
26
|
12
|
100
|
|
|
|
223
|
if ( $self->append ) { |
27
|
4
|
|
|
|
|
20
|
push @$headers, @{$self->append}; |
|
4
|
|
|
|
|
12
|
|
28
|
|
|
|
|
|
|
} |
29
|
12
|
100
|
|
|
|
82
|
if ( $self->unset ) { |
30
|
2
|
|
|
|
|
12
|
Plack::Util::header_remove($headers, $_) for @{$self->unset}; |
|
2
|
|
|
|
|
16
|
|
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
12
|
|
|
|
|
410
|
); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |