line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Application::Plugin::DevPopup::HTTPHeaders; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$CGI::Application::Plugin::DevPopup::HTTPHeaders::VERSION = '1.08'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
733
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
7
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
8
|
1
|
|
|
1
|
|
5
|
no warnings 'uninitialized'; # don't care about empty strings |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
9
|
1
|
|
|
1
|
|
5
|
use base qw/Exporter/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
634
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import |
12
|
|
|
|
|
|
|
{ |
13
|
1
|
|
|
1
|
|
7
|
my $c = scalar caller; |
14
|
1
|
|
|
|
|
6
|
$c->add_callback( 'devpopup_report', \&_header_report ); |
15
|
1
|
|
|
|
|
2056
|
goto &Exporter::import; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _header_report |
19
|
|
|
|
|
|
|
{ |
20
|
1
|
|
|
1
|
|
22
|
my $self = shift; |
21
|
1
|
|
|
|
|
6
|
my $env = _env_report($self); |
22
|
1
|
|
|
|
|
4
|
my $cgi = _cgi_report($self); |
23
|
1
|
|
|
|
|
5
|
my $out = $self->query->header($self->header_props); |
24
|
1
|
|
|
|
|
1440
|
$out =~ s/\r//g; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
6
|
$self->devpopup->add_report( |
27
|
|
|
|
|
|
|
title => 'HTTP Headers', |
28
|
|
|
|
|
|
|
summary => 'Incoming and outgoing HTTP headers', |
29
|
|
|
|
|
|
|
report => qq( |
30
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Incoming HTTP Headers | $cgi |
34
|
|
|
|
|
|
|
Outgoing HTTP Headers | $out | |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
) |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _env_report |
41
|
|
|
|
|
|
|
{ |
42
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
43
|
1
|
|
|
|
|
1
|
my $r=0; |
44
|
25
|
|
|
|
|
30
|
my $report = join $/, map { |
45
|
1
|
|
|
|
|
22
|
$r=1-$r; |
46
|
25
|
100
|
|
|
|
25
|
qq{ |
$_ | $ENV{$_} |
}
|
25
|
|
|
|
|
121
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
sort keys %ENV; |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
8
|
return $report; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub _cgi_report |
54
|
|
|
|
|
|
|
{ |
55
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
1
|
|
|
|
|
2
|
my $r=0; |
58
|
1
|
|
|
|
|
5
|
my $q = $self->query; |
59
|
1
|
|
|
|
|
8
|
my $report = ''; |
60
|
|
|
|
|
|
|
|
61
|
1
|
|
|
|
|
2
|
eval { |
62
|
1
|
|
|
|
|
283
|
$report = ' |
http |
' .
63
|
|
|
|
|
|
|
join $/, map { |
64
|
1
|
|
|
|
|
11
|
$r=1-$r; |
65
|
1
|
50
|
|
|
|
2
|
qq{ |
$_ | @{[$q->http($_)]} |
}
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
23
|
|
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
sort $q->http; |
68
|
|
|
|
|
|
|
}; |
69
|
|
|
|
|
|
|
|
70
|
1
|
50
|
|
|
|
47
|
return " |
Your query object doesn't have a http() method |
" if $@;
71
|
|
|
|
|
|
|
|
72
|
1
|
|
|
|
|
2
|
eval { |
73
|
0
|
|
|
|
|
0
|
$report .= ' |
https |
' .
74
|
|
|
|
|
|
|
join $/, , map { |
75
|
1
|
50
|
|
|
|
7
|
$r=1-$r; |
76
|
0
|
0
|
|
|
|
0
|
qq{ |
$_ | @{[$q->https($_)]} |
}
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
sort $q->https if $q->https; |
79
|
|
|
|
|
|
|
}; |
80
|
|
|
|
|
|
|
|
81
|
1
|
|
|
|
|
260
|
return $report; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; # End of CGI::Application::Plugin::DevPopup::HTTPHeaders |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
__END__ |