| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Plack::Middleware::ContentLength; |
|
2
|
41
|
|
|
41
|
|
287
|
use strict; |
|
|
41
|
|
|
|
|
120
|
|
|
|
41
|
|
|
|
|
1195
|
|
|
3
|
41
|
|
|
41
|
|
203
|
use warnings; |
|
|
41
|
|
|
|
|
126
|
|
|
|
41
|
|
|
|
|
1144
|
|
|
4
|
41
|
|
|
41
|
|
294
|
use parent qw( Plack::Middleware ); |
|
|
41
|
|
|
|
|
88
|
|
|
|
41
|
|
|
|
|
211
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
41
|
|
|
41
|
|
3168
|
use Plack::Util; |
|
|
41
|
|
|
|
|
160
|
|
|
|
41
|
|
|
|
|
15537
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub call { |
|
9
|
709
|
|
|
709
|
1
|
2257
|
my $self = shift; |
|
10
|
709
|
|
|
|
|
11437
|
my $res = $self->app->(@_); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return $self->response_cb($res, sub { |
|
13
|
672
|
|
|
672
|
|
2085
|
my $res = shift; |
|
14
|
672
|
|
|
|
|
15517
|
my $h = Plack::Util::headers($res->[1]); |
|
15
|
672
|
100
|
66
|
|
|
6249
|
if (!Plack::Util::status_with_no_entity_body($res->[0]) && |
|
|
|
|
100
|
|
|
|
|
|
16
|
|
|
|
|
|
|
!$h->exists('Content-Length') && |
|
17
|
|
|
|
|
|
|
!$h->exists('Transfer-Encoding') && |
|
18
|
|
|
|
|
|
|
defined(my $content_length = Plack::Util::content_length($res->[2]))) { |
|
19
|
586
|
|
|
|
|
5284
|
$h->push('Content-Length' => $content_length); |
|
20
|
|
|
|
|
|
|
} |
|
21
|
672
|
|
|
|
|
49341
|
}); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
__END__ |